Skip to Content.
Sympa Menu

coq-club - Re: [Coq-Club] Simple formalization of type of natural deduction proofs

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

Re: [Coq-Club] Simple formalization of type of natural deduction proofs


Chronological Thread 
  • From: Gert Smolka <smolka AT ps.uni-saarland.de>
  • To: coq-club AT inria.fr
  • Subject: Re: [Coq-Club] Simple formalization of type of natural deduction proofs
  • Date: Mon, 19 Feb 2018 15:54:16 +0100
  • Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=smolka AT ps.uni-saarland.de; spf=Pass smtp.mailfrom=smolka AT ps.uni-saarland.de; spf=None smtp.helo=postmaster AT triton.rz.uni-saarland.de
  • Ironport-phdr: 9a23:xwCH+xCp1wjIONY/4R70UyQJP3N1i/DPJgcQr6AfoPdwSPT6psbcNUDSrc9gkEXOFd2Cra4c0KyO6+jJYi8p2d65qncMcZhBBVcuqP49uEgeOvODElDxN/XwbiY3T4xoXV5h+GynYwAOQJ6tL1LdrWev4jEMBx7xKRR6JvjvGo7Vks+7y/2+94fcbglUijexe69+IAmrpgjNq8cahpdvJLwswRXTuHtIfOpWxWJsJV2Nmhv3+9m98p1+/SlOovwt78FPX7n0cKQ+VrxYES8pM3sp683xtBnMVhWA630BWWgLiBVIAgzF7BbnXpfttybxq+Rw1DWGMcDwULs5Xymp4aV2Rx/ykCoJNyI2/27KhMJ+gqJVvhCuqR94zYPPeo6ZKP9+c7ndfd8GR2dMWNtaWSxbAoO7aosCF+sPMvhCr4nhulAAsB6+BQ6oBOPs0DBDm3j73bY/0+QmFQHG3xYvEskWsHTPttn1KaESUeGswKnT1zrMdelW2TPn54jObx8tu+yDUqxpfMfX1EIhGQTFjlCKpozkOTOYzvkNs26a7+Z5TuKgkXQoqxt1oje1wMcjl5PFiZ8LxVzc6SV4zpg6Jdm2SEJhZt6kCpRQuieHPIV1WsMvW3xktSg1x7EcvZO2fTIGxZY9yxLBa/GLa5WE7xzsWeqLJTp1hWhpdK+8ihuz60Ss1/HwWtWy3V1XtCRKiMPMuWoI1xHL6siIVP99/kC51DaTzQDT6/1EIUcylabBMZ4gw6Q8locVsUTCByP2g1/5g7WMdkUg4Oeo7fnobq/7qZCCL4N0iwf+PboymsGnHOg1PAcDU3Kf9Om9zrHu/1f1TKtKg/Eul6nWqpHaJcAVpq6jBA9V154u6w26Dzeh1NQYnmMIIUldeBKclYTpJlfOIPHhAfekmVujii1rx/TcMb3nH5rBNGXMn6n5cbZn90Fc0BYzzcxY559MFr4BJ+vzVlbtu9zcEx82KBe5w/3nCdV4zoMRQ3iDAq6fMKPIsF+H/PgjI+eWZNxdhDGoIP88ovXqkHURmFkHfKDv04FERmq/G6FJLl+FKUHphdMCGC9epQ85SO/joEWZFyNVZjOpVqsm4jg9BMSqANGQFciWnLWd0XLjTdVtbWdcBwXUSCa6R8C/Q/4JLRmqDIpkmz0AW6KmTtV5hwm18hL8yv98J+PO/iQeudTv2YosvrGBpVQJ7TVxSv+l/SSVVWguxjEQXHkr2qE6ukV00FOK16Q+j/EKTYUOtcMMaR8zMNvn98I/C932XVieLMuTSUqhRJO8E3csSNN02NYHeUJ0Hdnkgh2Rhyc=

We cover intuitionistic / classical ND in an introductory class using Coq,
see lecture notes and Coq files at https://courses.ps.uni-saarland.de/icl_17/2/Resources.
This includes Glivenko’s theorem.

There is also a Coq development of Gentzen’s intuitionistic sequent calculus
showing that it is decidable and intereducible with intuitionistic ND, see
http://www.ps.uni-saarland.de/courses/cl-ss16/LectureNotes/html/toc.html.

Gert

On 19. Feb 2018, at 15:16, Kevin Sullivan <sullivan.kevinj AT gmail.com> wrote:

 I'm looking for a simplest way to teach my early undergraduate students about natural deduction and/or sequent calculus proof objects without having to get into lambda terms and type systems.

The following "POPL tutorial" suggests a standard solution:  formalize proofs  as values of an inductive type, where the constructors mirror the rules of inference.


The rule for implication introduction says (naturally enough) that if you have a function from proofs of A to proofs of B, you can construct a proof of (Impl A B).

A straightforward translation of this into Coq, as copied right below this sentence, results in a non-positivity error for the encoding of this inference rule.

/* variables */
Inductive var := mk_var: nat -> var.

/* propositions in my minimal propositional logic */

Inductive prop :=
   | atom: var -> prop
   | and: prop -> prop -> prop
   | impl: prop -> prop -> prop.

/* proof rules */

Inductive proof: prop -> Type  :=
  | axiom: forall A: prop, proof A
  | andIntro: forall A B: prop, proof A -> proof B -> proof (and A B)
  | andElimL: forall A B: prop, proof (and A B) -> proof A
  | andElimR: forall A B: prop, proof (and A B) -> proof B
  | implElim: forall A B: prop, proof A -> proof (impl A B) -> proof B
  | implIntro: forall A B: prop, (proof A -> proof B) -> proof (impl A B). (* oops!!! *)

What would be the canonical way to represent the same ideas in Coq in a way that works?

Again, the aim is a super-straightforward pedagogical explication of rules of natural deduction (or sequent calculus), for a propositional logic only, with the ability to "play around" by building proof terms by explicit application of introduction and elimination inference rules. 

Kevin

 




Archive powered by MHonArc 2.6.18.

Top of Page