作为Coq的练习,我试图证明下面的函数返回一对长度相等的列表。 Require Import List.
Fixpoint split (A B:Set)(x:list (A*B)) : (list A)*(list B) :=
match x with
|nil => (nil, nil)
|cons (a,b) x1 => let (ta, tb) := split A B x1 i
我有以下定义向量谓词,如果一个是一个集合(没有重复的元素)或不。我定义的成员与一个类型级布尔: import Data.Vect
%default total
data ElemBool : Eq t => t -> Vect n t -> Bool -> Type where
ElemBoolNil : Eq t => ElemBool {t=t} a [] False
我是新来的辅酶Q,我试图证明这一点...... Theorem andb_eq_orb :
forall (b c : bool),
(andb b c = orb b c) -> (b = c).
这是我的证明,但我碰到困难时,我得到的目标(假=真 - >假=真)。 Proof.
intros b c.
induction c.
destruct b.
refle
我试图证明一个矛盾,但我遇到了一个问题,试图向Agda证明由<>-wt-inv返回的西格玛域类型与所看到的相同西格玛在证明之前。 我希望uniq型证明能够帮助我,但我无法将它们放在一起。 我希望下面的代码中的注释给出足够的上下文。 -- given a type for (f ⟨⟩), we can derive that f is a function type
-- and we can p
我可以写函数 powApply : Nat -> (a -> a) -> a -> a
powApply Z f = id
powApply (S k) f = f . powApply k f
,并证明平凡: powApplyZero : (f : _) -> (x : _) -> powApp Z f x = x
powApplyZero f x = Refl
到目前为止,一切都