[英]Proof of application equality in coq
I have a sequence of applications in that way (f (f (fx))), being f an arbitrary function and any applications numbers sequences. 我以这种方式有一个应用程序序列(f(f(fx))),是f的任意函数和任何应用程序编号序列。 I want to prove that f (xy) and (x (fy)), x = (fff ...) and y = any value, it's equal. 我想证明f(xy)和(x(fy)),x =(fff ...)和y =任何值,它是相等的。 I need that proof in the code below: 我需要以下代码中的证明:
Fixpoint r_nat {A : Type} (a : nat) : A -> (A -> A) -> A :=
match a with
|S n => fun (x0 : A) (a0 : A -> A) => r_nat n (a0 x0) a0
|0 => fun (x0 : A) (_ : A -> A) => x0
end.
Theorem homomo_nat : forall {T} (f : T -> T) (h : T) (x : nat), (r_nat x (f h) f) = f ((r_nat x) h f) .
compute.
??.
Qed.
I try unfolding and refining but doesn't work. 我尝试展开和优化,但无法正常工作。
这应该可以通过对x
的感应( f
的施加次数)来解决。
I moved the argument (x:nat)
before (h:T)
. 我将参数(x:nat)
移到(h:T)
。 That makes the induction hypothesis stronger - it holds for all h
. 这使得归纳假设更强-它适用于所有 h
。 Then the proof is simply: 那么证明就是:
Theorem homomo_nat : forall {T} (f : T -> T) (x:nat) (h : T), (r_nat x (f h) f) = f ((r_nat x) h f) .
Proof.
induction x.
reflexivity.
intros. apply IHx.
Qed.
You can also "move the arguments around" with tactics to keep your original theorem if you prefer that... Start with intros; generalize dependent h.
如果愿意,您还可以使用策略“绕开论点”以保留原始定理intros; generalize dependent h.
intros; generalize dependent h.
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.