[英]Coq: how to apply hypothesis with internal “if” branch
I need to apply FixL_Accumulate to prove the goal, but the unification fails due to the let statements and internal "if-then-else". 我需要应用FixL_Accumulate来证明目标,但是由于let语句和内部的“ if-then-else”,统一操作失败。 The question is about how to match the shapes here?
问题是如何在这里匹配形状?
Require Import ZArith.
Inductive branch (A B C : Prop) : Prop :=
| Then: A -> B -> branch A B C
| Else: not A -> C -> branch A B C
.
Definition itep (A B C : Prop) := (A -> B) /\ (~A -> C).
Axiom ite_then : forall A B C : Prop, itep A B C -> A -> B.
Axiom ite_else : forall A B C : Prop, itep A B C -> ~A -> C.
Axiom ite_both : forall A B C : Prop, itep A B C -> (B \/ C).
Axiom contrap: forall P Q : Prop, (P -> Q) -> ~Q -> ~P.
Parameter L_Accumulate : Z -> Z -> Z.
Hypothesis FixL_Accumulate: forall (n c: Z),
let x := ((L_Accumulate n c))%Z in
let x_1 := (n - 1%Z)%Z in itep ((n <= 0)%Z) ((x = c)%Z)
(((n + ((L_Accumulate x_1 c%Z))) = x)%Z).
Goal
forall (i c : Z),
(i > 0)%Z ->
((((L_Accumulate i%Z c%Z)) = ((i + ((L_Accumulate (i - 1%Z)%Z c%Z))))%Z)).
Proof.
intros.
(* something like: apply (@FixL_Accumulate i c). *)
Qed.
I've found the solution. 我找到了解决方案。 The issue was because of the symmetry.
问题是因为对称。 Thus the question was incorrect.
因此,这个问题是不正确的。
Proof.
intros.
symmetry.
apply (@FixL_Accumulate i c).
intuition.
Qed.
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.