我正在使用数学组件库,并试图证明这一点:
Lemma card_sub_ord (k : nat) (P : nat -> bool) :
#|[set i : 'I_k | P i]| <= k.
Proof.
set S := [set i : 'I_k | P i].
have H1 : S \subset 'I_k.
by apply: subset_predT.
have H2 : #|S| <= #|'I_k|.
by apply: subset_leq_card.
have H3 : k = #|'I_k|.
by rewrite card_ord.
(* Only goal left: #|S| <= k *)
rewrite H3 (* <--- this fails *)
Admitted.
最后一次重写失败并显示错误消息:
错误:重写时的依赖类型错误
(fun _pattern_value_ : nat => is_true (#|S| <= _pattern_value_)
关于重写失败的原因或此错误消息的解释的任何想法?