Library CoqUniquenessTacEx
Require Import Coq.Arith.Peano_dec.
Require Import Coq.Lists.SetoidList.
Require Import Coq.omega.Omega.
Require Import CoqUniquenessTac.
The examples go through more smoothly if we declare eq_nat_dec
as a hint.
Scheme le_ind' := Induction for le Sort Prop.
Lemma le_unique : forall (x y : nat) (p q: x <= y), p = q.
Uniqueness of proofs for predicates on lists often comes up when
discussing extensional equality on finite sets, as implemented by
the FSets library.
Section Uniqueness_Of_SetoidList_Proofs.
Variable A : Type.
Variable R : A -> A -> Prop.
Hypothesis R_unique : forall (x y : A) (p q : R x y), p = q.
Hypothesis list_eq_dec : forall (xs ys : list A), {xs = ys} + {xs <> ys}.
Scheme lelistA_ind' := Induction for lelistA Sort Prop.
Scheme sort_ind' := Induction for sort Sort Prop.
Scheme eqlistA_ind' := Induction for eqlistA Sort Prop.
Theorem lelistA_unique :
forall (x : A) (xs : list A) (p q : lelistA R x xs), p = q.
Theorem sort_unique :
forall (xs : list A) (p q : sort R xs), p = q.
Theorem eqlistA_unique :
forall (xs ys : list A) (p q : eqlistA R xs ys), p = q.
End Uniqueness_Of_SetoidList_Proofs.
uniqueness can show that the only vector of length zero is the
empty vector. This shows that the tactic is not restricted to
working only on Props.
Inductive vector (A : Type) : nat -> Type :=
| vnil : vector A 0
| vcons : forall (n : nat) (a : A), vector A n -> vector A (S n).
Theorem vector_O_eq : forall (A : Type) (v : vector A 0),
v = vnil _.
This page has been generated by coqdoc