coq-club AT inria.fr
Subject: The Coq mailing list
List archive
- From: Daniel Schepler <dschepler AT gmail.com>
- To: Coq Club <coq-club AT inria.fr>
- Subject: Re: [Coq-Club] Simple formalization of type of natural deduction proofs
- Date: Mon, 19 Feb 2018 08:50:53 -0800
- Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=dschepler AT gmail.com; spf=Pass smtp.mailfrom=dschepler AT gmail.com; spf=None smtp.helo=postmaster AT mail-oi0-f41.google.com
- Ironport-phdr: 9a23:XpIc2h2SINs0oOSFsmDT+DRfVm0co7zxezQtwd8ZseIWLfad9pjvdHbS+e9qxAeQG9mDsLQc06L/iOPJYSQ4+5GPsXQPItRndiQuroEopTEmG9OPEkbhLfTnPGQQFcVGU0J5rTngaRAGUMnxaEfPrXKs8DUcBgvwNRZvJuTyB4Xek9m72/q99pHPbQhEniaxba9vJxiqsAvdsdUbj5F/Iagr0BvJpXVIe+VSxWx2IF+Yggjx6MSt8pN96ipco/0u+dJOXqX8ZKQ4UKdXDC86PGAv5c3krgfMQA2S7XYBSGoWkx5IAw/Y7BHmW5r6ryX3uvZh1CScIMb7Vq4/Vyi84Kh3SR/okCYHOCA/8GHLkcx7kaZXrAu8qxBj34LYZYeYP+d8cKzAZ9MXXWhOXshRWSJPAY2ycpUBAPYOM+tDs4n9vkEDoQeiCQWwBu7izCJDiH/s3a091uQsCQ/I0xYmH9IPrnvUqMj+OroOXuC10qbI1THDYO1M2Tzg74XHbwshru2MXb1uacrRzVcgFxneg1WfrIzqJTKV1uAXv2eH6OpgUPuihmg6oA9/pTivw90jiojPho8NxVDE9Dl5wIYoJdKjUkJ0fdmkEJ5IuyGGOYp5XMciQ29ytCY90L0Gtpi2dzUJxpQ/3xPTdeCLfoyS7h/gVOudOyl0iG9mdb6liBu+7E6twfDmWMauylZFtC9Fn8HMtn8T0xzT7dCKSv5n8Ueg3TaDzgfT6uBYLUwtm6rWJIMtzqQ/lpoUtkTDESv2l1vsgKCKcUUk//Ck6+XhYrr4up+RL5F4hh36P6g0mcGyAf40PhYTU2WY4+ix26Dv8VX8QLpQj/02lqfZsIrdJcQevqO2HhRV3Zoj6xmhFzem1MoXnWMcIVJKfRKIlYnpO1XULP/kCve/hkygkC13yPDeIr3hHpLNI2Dfn7fmZLZx8lJTyA4uzd9E/J9UEbEAIPfrWkDrrtDYDxk5Mxa1w+n9Etl92JkeCiqzBfqyN7qamluV7Kp7KO6VIYQRpTzVKv4/5veog2VvynEHeqz88ZIRaX28Vs9tI0iBZXf2yoMNCmwKsxI6QfbCh1iLUDoVbHG3CfFvrgonAZ6rWN+QDrumh6aMiWLiRsUPNzJ2T2uUGHKtTL2qHvIFaSacOMhky2VWWr2oSotn3har5lajl+hXa9HM8yhdjqrNkcBv7rSKxx43/D1wSc+a1jPVFjwmriYzXzYzmZtHjwl9x1OEi/UqhvVZEZlU5qsMXFtjc5HbyON+Bpb5XQeTJto=
On Mon, Feb 19, 2018 at 6:16 AM, 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.
I have a development of both under
https://github.com/dschepler/coq-sequent-calculus . It's not
extremely well commented, though, so I'm not sure how useful it would
be for beginners.
> The following "POPL tutorial" suggests a standard solution: formalize
> proofs as values of an inductive type, where the constructors mirror the
> rules of inference.
>
> http://twelf.org/wiki/POPL_Tutorial/Sequent_vs_Natural_Deduction#Syntax_for_Propositions
Well, my development actually made an inductive proposition of
provability - but it would hopefully be simple enough to change that
to a type of proof objects if needed.
> 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).
I think that might be mixing up the formal structure of an implication
proof on the one hand, and the interpretation of such a proof as a
function on the other. In particular, my ND_proves proposition is a
function "list (prop atom) -> prop atom -> Prop" of both a context and
a goal, with the context being a crucial ingredient because in natural
deduction proofs, the context to the left of the turnstyle varies
through the different parts of the proof tree. In particular, the
form of an implication proof is:
| ND_cond_proof {Γ P Q} :
P :: Γ ⊢ Q ->
Γ ⊢ P ⊃ Q
And then I didn't develop this explicitly, though I did develop an
interpretation in terms of Heyting algebras which could be adapted.
But the interpretation of a proof object in Γ ⊢ P as a function in the
sense of Curry-Howard would look something like an element of
(fold_left (fun (Q : prop) (X : Type) => prop_interp Q -> X) Γ
(prop_interp P)) where
Variable type_assign : atom -> Type.
Fixpoint prop_interp (P : prop atom) : Type :=
match P with
| atom_prop x => type_assign x
| bot_prop => Empty_set
| top_prop => unit
| and_prop Q R => prop_interp Q * prop_interp R
| or_prop Q R => prop_interp Q + prop_interp R
| impl_prop Q R => prop_interp Q -> prop_interp R (* <- this term is
probably what you were thinking of *)
end.
In this formulation, the interpretation types of both sides of
ND_cond_proof end up being pretty much the same, so the corresponding
map of interpretation types would just be essentially the identity
map.
> 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.
I think the definition of ND_proves (or classic_ND_proves in
ClassicalND.v) should be straightforward enough to read. And it would
be easy to play around with constructing proofs using the proof rules
- I don't remember having too many examples of intuitionistic natural
deduction, except as steps in equivalence proofs with my formulations
of sequent calculus and with a Hilbert-style proof system. But in
ClassicalND.v, I do have example proofs of excluded middle and
Peirce's law based on the classical proof rule of "proof by
contradiction". For this part, what I wrote above about Curry-Howard
style interpretations of proof objects as functions wouldn't be needed
at all.
Though be warned I did make a few choices which are apparently
nonstandard. For example, my formulation includes an explicit cut
rule even though it could easily be deduced from a combination of the
"conditional proof" and "modus ponens" rules. (This was because my
intended interpretation of this proof rule was more like "let x :=
interp phi in interp psi" rather than "(fun x => interp psi) (interp
phi)".) On the other hand, the version of sequent calculus I
presented is a cut-free version since my goal there was to formalize a
proof of the cut elimination theorem.
(Also, I developed that in Coq 8.5, I think, so I can't promise all
the proofs would still work in the latest Coq version.)
--
Daniel Schepler
- [Coq-Club] Simple formalization of type of natural deduction proofs, Kevin Sullivan, 02/19/2018
- Re: [Coq-Club] Simple formalization of type of natural deduction proofs, Kevin Sullivan, 02/19/2018
- Re: [Coq-Club] Simple formalization of type of natural deduction proofs, Gert Smolka, 02/19/2018
- Re: [Coq-Club] Simple formalization of type of natural deduction proofs, Kevin Sullivan, 02/19/2018
- Re: [Coq-Club] Simple formalization of type of natural deduction proofs, Daniel Schepler, 02/19/2018
- Re: [Coq-Club] Simple formalization of type of natural deduction proofs, Pierre Courtieu, 02/27/2018
- Re: [Coq-Club] Simple formalization of type of natural deduction proofs, Julien Narboux, 02/28/2018
- Re: [Coq-Club] Simple formalization of type of natural deduction proofs, manoury, 02/28/2018
- Re: [Coq-Club] Simple formalization of type of natural deduction proofs, Julien Narboux, 02/28/2018
- Re: [Coq-Club] Simple formalization of type of natural deduction proofs, Pierre Courtieu, 02/27/2018
Archive powered by MHonArc 2.6.18.