diff options
author | Enrico Tassi <gareuselesinge@debian.org> | 2015-01-25 14:42:51 +0100 |
---|---|---|
committer | Enrico Tassi <gareuselesinge@debian.org> | 2015-01-25 14:42:51 +0100 |
commit | 7cfc4e5146be5666419451bdd516f1f3f264d24a (patch) | |
tree | e4197645da03dc3c7cc84e434cc31d0a0cca7056 /theories/Logic/FunctionalExtensionality.v | |
parent | 420f78b2caeaaddc6fe484565b2d0e49c66888e5 (diff) |
Imported Upstream version 8.5~beta1+dfsg
Diffstat (limited to 'theories/Logic/FunctionalExtensionality.v')
-rw-r--r-- | theories/Logic/FunctionalExtensionality.v | 32 |
1 files changed, 30 insertions, 2 deletions
diff --git a/theories/Logic/FunctionalExtensionality.v b/theories/Logic/FunctionalExtensionality.v index 7d7792d5..eb50a3aa 100644 --- a/theories/Logic/FunctionalExtensionality.v +++ b/theories/Logic/FunctionalExtensionality.v @@ -1,6 +1,6 @@ (************************************************************************) (* v * The Coq Proof Assistant / The Coq Development Team *) -(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2014 *) +(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2015 *) (* \VV/ **************************************************************) (* // * This file is distributed under the terms of the *) (* * GNU Lesser General Public License Version 2.1 *) @@ -19,6 +19,12 @@ Proof. auto. Qed. +Lemma equal_f_dep : forall {A B} {f g : forall (x : A), B x}, + f = g -> forall x, f x = g x. +Proof. +intros A B f g <- H; reflexivity. +Qed. + (** Statements of functional extensionality for simple and dependent functions. *) Axiom functional_extensionality_dep : forall {A} {B : A -> Type}, @@ -31,13 +37,35 @@ Proof. intros ; eauto using @functional_extensionality_dep. Qed. +(** Extensionality of [forall]s follows from functional extensionality. *) +Lemma forall_extensionality {A} {B C : A -> Type} (H : forall x : A, B x = C x) +: (forall x, B x) = (forall x, C x). +Proof. + apply functional_extensionality in H. destruct H. reflexivity. +Defined. + +Lemma forall_extensionalityP {A} {B C : A -> Prop} (H : forall x : A, B x = C x) +: (forall x, B x) = (forall x, C x). +Proof. + apply functional_extensionality in H. destruct H. reflexivity. +Defined. + +Lemma forall_extensionalityS {A} {B C : A -> Set} (H : forall x : A, B x = C x) +: (forall x, B x) = (forall x, C x). +Proof. + apply functional_extensionality in H. destruct H. reflexivity. +Defined. + (** Apply [functional_extensionality], introducing variable x. *) Tactic Notation "extensionality" ident(x) := match goal with [ |- ?X = ?Y ] => (apply (@functional_extensionality _ _ X Y) || - apply (@functional_extensionality_dep _ _ X Y)) ; intro x + apply (@functional_extensionality_dep _ _ X Y) || + apply forall_extensionalityP || + apply forall_extensionalityS || + apply forall_extensionality) ; intro x end. (** Eta expansion follows from extensionality. *) |