1
要儘可能地隔離這個問題,假設我開始一個Coq會話,如下所示。Coq:根據唯一性和存在定理定義一個函數
Parameter A : Type.
Parameter B : Type.
Parameter P : A -> B -> Prop.
Axiom existence : forall a : A, exists b : B, P a b.
Axiom uniqueness : forall a : A, forall b b' : B, P a b -> P a b' -> b = b'.
從這裏,我想定義一個函數f : A -> B
的獨特功能,其P a (f a)
總是真。
我該怎麼做? 罐我這樣做?很顯然,我應該開始像
Definition f : A -> B.
intro a.
assert (E := existence a).
assert (U := uniqueness a).
...但實際上,我怎麼寫函數在這些假設條件是什麼?
對不起,接受這個答案花了這麼長時間。你的第二個例子適用於我,實際上甚至可以在'Type'中使用'A'和'B'。謝謝! – Ian