For a simple inductive type like the natural numbers nat
, it is easy to prove that the two constructors (zero and successor) give all possible natural numbers,
Lemma nat_destruct (n : nat) : n = O \/ exists m : nat, n = S m.
Proof.
destruct n. left. reflexivity. right. exists n. reflexivity.
Qed.
However I hear it is not so simple for equality proofs. There is only one equality constructor, eq_refl
, but Coq cannot prove that
eq_destruct : forall (A : Type) (x : A) (prEq : x = x), prEq = eq_refl
What exactly blocks this proof ? Probably a first problem is that equality is not just a type, but a type family eq : forall A : Type, A -> A -> Prop
. Is there a simpler type family where such a proof is impossible ? With 1 or 2 arguments instead of 3 maybe ?