繁体   English   中英

Coq中的应用程序相等性证明

[英]Proof of application equality in coq

我以这种方式有一个应用程序序列(f(f(fx))),是f的任意函数和任何应用程序编号序列。 我想证明f(xy)和(x(fy)),x =(fff ...)和y =任何值,它是相等的。 我需要以下代码中的证明:

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. 

我尝试展开和优化,但无法正常工作。

这应该可以通过对x的感应( f的施加次数)来解决。

我将参数(x:nat)移到(h:T) 这使得归纳假设更强-它适用于所有 h 那么证明就是:

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.

如果愿意,您还可以使用策略“绕开论点”以保留原始定理intros; generalize dependent h. intros; generalize dependent h.

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM