Coq 如何简化引理的陈述
我在假设中有一个矛盾的陈述。要将其转换为true=false。提前谢谢你的指导。这是代码Coq 如何简化引理的陈述,coq,Coq,我在假设中有一个矛盾的陈述。要将其转换为true=false。提前谢谢你的指导。这是代码 n < current_value 0 (n :: l) current_value 0 (n :: l)<= n. n
n < current_value 0 (n :: l)
current_value 0 (n :: l)<= n.
n<当前值0(n::l)
当前_值0(n::l)这个问题可能要完整得多。n
的类型是什么?我假设它是nat
这样开始:
Lemma manual:
forall current_value n l P,
n < current_value 0 (n :: l) ->
current_value 0 (n :: l) <= n ->
P.
Proof.
intros.
此查询表示“假设我知道执行时n
和m,引理自动:错误消息”在嵌套的Ltac调用“lia”和“xlia(策略)”中,最后一次调用失败。在对“lia”和“xlia(策略)”的嵌套Ltac调用中,最后一次调用失败。战术失败:错误的逻辑碎片。”。对于引理手册:消息是“无法统一”“S?M1402您使用哪种版本的coq?上面给出的脚本适用于coq-8.11中的coq-8.12,它也适用。在coq-8.10中,lia
抱怨您的错误消息。您必须将P
替换为lia
不知道的常数:False
。例如,通过lia使用以下行assert(abs:False);破坏abs。
我使用的是Coq 8.8.0。我已将P替换为False。仍然显示错误的片段消息。
H : n < current_value 0 (n :: l)
H0 : current_value 0 (n :: l) ≤ n
-----
P
Search (?n < ?m -> ?m <= ?p -> _).
Nat.lt_le_trans:
forall n m p : nat, n < m -> m <= p -> n < p
{
apply Nat.lt_le_trans with (m := current_value 0 (n :: l)).
auto.
auto.
}
H1 : n < n
-----
P
Search (~ ?n < ?n).
Nat.lt_irrefl: forall x : nat, ~ x < x
apply Nat.lt_irrefl in H1.
H1 : False
-----
P
tauto.
Qed.
Require Import Lia.
Lemma automatic:
forall current_value n l P,
n < current_value 0 (n :: l) ->
current_value 0 (n :: l) <= n ->
P.
Proof.
intros.
lia.
Qed.