coq - 如何证明从典型类型到“Prop”的所有函数 P、Q,“forall a, b, P(a) or Q(b) 成立”当且仅当“forall a, P(a), or, forall b, Q (b), 持有”?
问题描述
Lemma forall_P_Q_a_b_notPa_or_notPb_iff_forall_a_notPa_or_forall_b_notPb : forall (T : Type) (P Q : T->Prop),
(forall a b, P a \/ Q b) <-> ((forall a, P a) \/ (forall b, Q b))
.
Proof.
intros. split; intros.
- admit.
- destruct H; auto.
Admitted.
我很容易证明了一方,但找不到证明另一方的方法。
edestruct
由于范围,对我不起作用。我应该如何证明这个定理?
解决方案
我相信这需要经典逻辑:
Require Import Coq.Logic.Classical.
Lemma forall_P_Q_a_b_notPa_or_notPb_iff_forall_a_notPa_or_forall_b_notPb : forall (T : Type) (P Q : T->Prop),
(forall a b, P a \/ Q b) <-> ((forall a, P a) \/ (forall b, Q b))
.
Proof.
intros T P Q. split; intros H.
- destruct (classic (forall a, P a)) as [HP|HP]; auto. (* Classical reasoning *)
destruct (not_all_ex_not _ _ HP) as [a Ha]. (* Also here *)
right; intros b.
specialize (H a b). tauto.
- destruct H; auto.
Qed.
推荐阅读
- email - com.sun.mail.smtp.SMTPAddressFailedException: 550 5.7.1 中继被 Java Mail API 拒绝
- android - 非生命周期类中的 Kotlin 协程范围和作业取消
- javascript - 如何在 Promise 中包装条件语句
- sql - 如何在 BLoC 模式中调用 sink.fromFuture?
- python - Pandas Series 使用字符串和嵌套列表访问值之间的区别
- javascript - 路由后引导模式不再工作
- reactjs - 反应情感CSS - 模板文字返回函数不是值
- python - 当变量等于 x 时触发事件 - python
- javascript - Safari 的 documentFragment.querySelector 问题
- python - PyYAML 不解析所有示例