proof - Proving non-existence of an infinite inductive value in Coq -
suppose have simple inductive type:
inductive ind : set := | ind0 : ind | ind1 : ind -> ind.
and i'd prove values can't exist. specifically, there can't non-well-founded values: ~exists i, = ind1 i
.
i've looked around bit on internet , came nothing. able write:
fixpoint depth (i : ind) : nat := match | ind0 => 0 | ind1 i2 => 1 + depth i2 end. goal ~exists i, = ind1 i. proof. intro. inversion_clear h. remember (depth x) d. induction d. rewrite h0 in heqd; simpl in heqd. discriminate. rewrite h0 in heqd; simpl in heqd. injection heqd. assumption. qed.
which works, seems really ugly , non-general.
i don't think there general method proving such goals. experience, has not seemed such problem, however. in case, there simpler proof, using congruence
tactic:
inductive ind : type := | ind0 : ind | ind1 : ind -> ind. goal ~exists i, = ind1 i. proof. intros [x hx]. induction x; congruence. qed.
Comments
Post a Comment