简体   繁体   中英

How to prove for all functions P, Q from typical type to `Prop`, “forall a, b, P(a) or Q(b) holds” iff “forall a, P(a), or, forall b, Q(b), holds”?

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.

I proved the one side easily, but couldn't find a way to prove the other side. edestruct didn't work for me due to the scope. How should I prove the theorem?

I believe this requires classical logic:

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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