coq-club AT inria.fr
Subject: The Coq mailing list
List archive
- From: "Soegtrop, Michael" <michael.soegtrop AT intel.com>
- To: "coq-club AT inria.fr" <coq-club AT inria.fr>
- Subject: RE: [Coq-Club] Proof Involving Arith in Both Z and Nat
- Date: Sat, 1 Dec 2018 07:41:44 +0000
- Accept-language: de-DE, en-US
- Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=michael.soegtrop AT intel.com; spf=Pass smtp.mailfrom=michael.soegtrop AT intel.com; spf=None smtp.helo=postmaster AT mga03.intel.com
- Dlp-product: dlpe-windows
- Dlp-reaction: no-action
- Dlp-version: 11.0.400.15
- Ironport-phdr: 9a23:WmUgbBJW28qHWC3+JdmcpTZWNBhigK39O0sv0rFitYgeL/zxwZ3uMQTl6Ol3ixeRBMOHs6IC07KempujcFRI2YyGvnEGfc4EfD4+ouJSoTYdBtWYA1bwNv/gYn9yNs1DUFh44yPzahANS47xaFLIv3K98yMZFAnhOgppPOT1HZPZg9iq2+yo9JDffwZFiCChbb9uMR67sRjfus4KjIV4N60/0AHJonxGe+RXwWNnO1eelAvi68mz4ZBu7T1et+ou+MBcX6r6eb84TaFDAzQ9L281/szrugLdQgaJ+3ART38ZkhtMAwjC8RH6QpL8uTb0u+ZhxCWXO9D9QLYpUjqg8qhrUgflhicZOTAk7GHZhM9+jKxZrxKguxNwzIHabZqJNPVleq7RYc8WSXZDU8tXSidPApm8b4wKD+cZM+pWso79qEUBrRuiHwmsA/vvxidVjXHx3K01z+QhHhvY0wwkEd4FrXPZrND0NKgOUeC61rfHzTHZY/NN3jfy9ofIcgw7ofGLRbJ9asvRyU8zFwzbilWcs5DqPzSQ1ukUtWWQ8uRuVeWqi2E9qgFxpCCixsYqionVmI0VzkrI+jhnz4szONa2S1Z7bMa5HJZeuCyWLZZ6T80tTm1ypSo3xLwLtYS6cSUK0Jgr2h/SZvKdf4WG7B/vTvidLDl8iX5/Zb6yhAi+/VC9xuD9UsS4ykhGoypKn9XWqHwBzQHf58aBR/Bg5EmuwyyP2BrW6uxcIUA7i67bK5k5z741mZocq1jPEyHslEX3iq+Walsr+uyy5+v7ZbXmo4eQN45yig7gLqQjgtGzDOo3PwQUQmSW9+ux2Kf+8UD3QbhGlPw7n6nBvJDfP8sbp6q5AwFP0oYk7hayFzKm0NUEknkHNl1KZhaHg5LyO1HJPv/4Auu/g06rkDdz3P3GP7vhAonTIXjHirvuYbF960tExAop0d9f/45UCq0GIP/rRkDxs8XYAgYlPAyw3uboE85w1pgeWGKKGq+WKrnesV6O5uI1IumDfpUZuDjnK6tt2/m7x3Q+gBoWebSj9ZoRcnGxWPp8aQ3Nan31x9wFDG0ivwwkTeWshkfUAhBJYHPnFZk76z4nEoW+Sc/mR4utibGFlm/vG5xdZmlLDhaXFnrna5+DQ98Nbj6fJolqlTlSBuvpcJMoyRz77Fyy8LFgNOeBonRJ56Km78B84qjorT938DV1C8qH1GTUFjN1mH8FQ3k926Ut+BUhmGfG6rBxhrljLfIW/+lAC15oNJjAwug8ANf3CFqYI4W5DW2+S9DjOgkfC9I8x9hXPBR4FNz61VbC2TanB/kekLnZXJE=
Dear Matt,
did you try the zify tactic which converts nat in your context into Z? The
tactic is not really documented but mentioned in a footnote in the Micromega
section.
Best regards,
Michael
> -----Original Message-----
> From:
> coq-club-request AT inria.fr
>
> [mailto:coq-club-request AT inria.fr]
> On Behalf
> Of Matt Quinn
> Sent: Saturday, December 1, 2018 7:12 AM
> To: Coq-Club Club
> <coq-club AT inria.fr>
> Subject: [Coq-Club] Proof Involving Arith in Both Z and Nat
>
> Hello all,
>
> I would appreciate some advice on a proof I'm stuck on involving both
> naturals
> and integers. I have defined this Record with t and r represented in Z:
>
> Record netstate := NetState {t : Z; r : Z; c1 : channel; c2 : channel}.
>
> And I can successfully prove this lemma stating that t and r are always >=
> 0 in the
> context of a simple evaluation relation:
>
> Definition safety1 (st' : netstate) : Prop := st'.(t) >= 0 /\ st'.(r) >= 0.
> Lemma safety1_holds: forall st st' : netstate, (netEvalR st st') -> safety1
> st'.
>
> However, when I attempt to prove another lemma stating that t, r, and the
> length of both channels always sums to 10:
>
> Definition safety2 (st' : netstate) : Prop :=
> List.length st'.(c1) + List.length st'.(c2) + st'.(t) + st'.(r) = 10.
> Lemma safety2_holds : forall st st' : netstate, (netEvalR st st') ->
> safety2 st'.
>
> I of course cannot proceed because list lengths are naturals, while t and r
> are in
> Z.
>
> I can prove safety2_holds if I represent t and r as nat instead of Z, but I
> want to
> keep them in Z. What then is the best way to proceed? Should I use Z.of_nat
> on
> the list lengths or Z.to_nat on variables t and r? I've played with both
> paths but
> don't see a clear way forward through the subsequent match case
> destructions.
> Or is there some corollary I should set up given that I've already proven
> that t
> and r are always effectively natural themselves?
>
> Matt
Intel Deutschland GmbH
Registered Address: Am Campeon 10-12, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de
Managing Directors: Christin Eisenschmid
Chairperson of the Supervisory Board: Nicole Lau
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928
- [Coq-Club] Proof Involving Arith in Both Z and Nat, Matt Quinn, 12/01/2018
- RE: [Coq-Club] Proof Involving Arith in Both Z and Nat, Soegtrop, Michael, 12/01/2018
- Re: [Coq-Club] Proof Involving Arith in Both Z and Nat, Matt Quinn, 12/02/2018
- RE: [Coq-Club] Proof Involving Arith in Both Z and Nat, Soegtrop, Michael, 12/01/2018
Archive powered by MHonArc 2.6.18.