How can I prove propositional extensionality in Coq?

ⅰ亾dé卋堺 提交于 2019-12-12 10:45:07

问题


I'm trying to prove a substitution theorem about Prop, and I'm failing miserably. Can the following theorem be proven in coq, and if not, why not.

  Theorem prop_subst:
    forall (f : Prop -> Prop) (P Q : Prop), 
      (P <-> Q) -> ((f P) <-> (f Q)).

The point is that the proof, in logic, would be by induction. Prop isn't defined inductively, as far as I can see. How would such a theorem be proven in Coq?


回答1:


Here's the answer: The property I was looking for is called propositional extensionality, and means that forall p q : Prop, (p <-> q) -> (p = q). The converse, is trivial. This is something that is defined in Library Coq.Logic.ClassicalFacts, together with other facts from classical, i.e., non-intuitionistic logic. The above definition is called prop_extensionality, and can be used as follows: Axiom EquivThenEqual: prop_extensionality. Now you can apply the EquivThenEqual, use it for rewriting, etc. Thanks to Kristopher Micinski for pointing towards extensionality.




回答2:


What you are looking for is called "extensionality:"

http://coq.inria.fr/V8.1/faq.html#htoc41

http://coq.inria.fr/stdlib/Coq.Logic.FunctionalExtensionality.html

http://en.wikipedia.org/wiki/Extensionality

EDIT:

You can admit predicate extensionality, as noted in the Coq FAQ.




回答3:


This is propositional extentionality.

Lemma blah: forall (P Q: Prop), (forall (f:Prop -> Prop), f Q -> f P) -> P = Q.
  intros P Q H.
  apply (H (fun x => x = Q)).
  reflexivity.
Qed.

Section S.

Hypothesis prop_subst:
  forall (f : Prop -> Prop) (P Q : Prop), 
    (P <-> Q) -> ((f P) <-> (f Q)).

Lemma prop_subst_is_ext: forall P Q, (P <-> Q) -> P = Q.
  intros.
  apply blah.
  intro f.
  destruct (prop_subst f P Q); assumption.
Qed.

End S.

Check prop_subst_is_ext.


来源:https://stackoverflow.com/questions/11071165/how-can-i-prove-propositional-extensionality-in-coq

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!