coq - 无法破坏假设中的存在

标签 coq

有人能向我解释为什么应用于相同假设(双射 f)的相同策略(破坏)在第一个引理中起作用,而在第二个引理中不起作用吗?另外,我应该怎么做才能修复它?我想这与第二个引理的陈述中混合 Prop 和 Type 有关,但我不明白这里到底发生了什么。预先感谢您。

Require Import Setoid.

Definition injective {A B: Type} (f: A->B) :=
forall x y: A, f x = f y -> x = y.

Definition bijective {A B: Type} (f: A->B) :=
exists g: B->A, (forall x: A, g (f x) = x) /\ (forall y: B, f (g y) = y).

Definition decidable (t: Type): Type:=
(forall x y: t, {x=y}+{x<>y}).

Lemma bijective_to_injective:
forall t1 t2: Type,
forall f: t1 -> t2,
bijective f -> injective f.
Proof.
intros t1 t2 f H1.
destruct H1 as [g [H1 H2]]. (* <--- WORKS HERE *)
intros x y H3.
rewrite <- H1.
rewrite <- H1 at 1.
rewrite H3.
reflexivity.
Qed.

Lemma bijective_dec:
forall t1 t2: Type,
forall f: t1 -> t2,
bijective f ->
decidable t1 ->
decidable t2.
Proof.
intros t1 t2 f H1 H2 x y.
destruct H1 as [g [H1 H2]]. (* <--- DOESN´T WORK HERE *)
Qed.

最佳答案

事实上,您的问题是您需要一个所谓的“双射”“信息定义”,也就是说,您可以在其中提取实际证据,例如:

{ g: B -> A | cancel f g /\ cancel g f }

关于coq - 无法破坏假设中的存在,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43395845/

相关文章:

Coq 无法区分依赖类型归纳命题的构造函数

types - Coq 数据类型 - 带括号的一对

coq - Coq 中的受限归纳类型定义

coq - 使用 "rewrite [hypothesis with implication]"

coq - Coq证明中如何加强归纳假设?

coq - 相互定义的归纳类型的可判定相等定义

coq - 二阶统一与重写

typeclass - 在类型类中使用类型类实例

coq - `auto` 如何与条件(if)交互