adamc@616: (* Copyright (c) 2009, Adam Chlipala adamc@616: * All rights reserved. adamc@616: * adamc@616: * Redistribution and use in source and binary forms, with or without adamc@616: * modification, are permitted provided that the following conditions are met: adamc@616: * adamc@616: * - Redistributions of source code must retain the above copyright notice, adamc@616: * this list of conditions and the following disclaimer. adamc@616: * - Redistributions in binary form must reproduce the above copyright notice, adamc@616: * this list of conditions and the following disclaimer in the documentation adamc@616: * and/or other materials provided with the distribution. adamc@616: * - The names of contributors may not be used to endorse or promote products adamc@616: * derived from this software without specific prior written permission. adamc@616: * adamc@616: * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" adamc@616: * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE adamc@616: * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE adamc@616: * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE adamc@616: * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR adamc@616: * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF adamc@616: * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS adamc@616: * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN adamc@616: * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) adamc@616: * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE adamc@616: * POSSIBILITY OF SUCH DAMAGE. adamc@616: *) adamc@616: adamc@616: Set Implicit Arguments. adamc@616: adamc@616: adamc@616: Axiom ext_eq : forall dom ran (f g : forall x : dom, ran x), adamc@616: (forall x, f x = g x) adamc@616: -> f = g. adamc@616: adamc@616: Theorem ext_eq_forall : forall dom (f g : forall x : dom, Type), adamc@616: (forall x, f x = g x) adamc@616: -> (forall x, f x) = (forall x, g x). adamc@616: intros. adamc@616: rewrite (ext_eq _ f g H); reflexivity. adamc@616: Qed. adamc@616: adamc@616: Theorem ext_eq_forallS : forall dom (f g : forall x : dom, Set), adamc@616: (forall x, f x = g x) adamc@616: -> (forall x, f x) = (forall x, g x). adamc@616: intros. adamc@616: rewrite (ext_eq _ f g H); reflexivity. adamc@616: Qed.