Zulip Chat Archive

Stream: Is there code for X?

Topic: conditional iff


Peter Nelson (Jun 21 2023 at 19:09):

Is there something tantamount to the following easily proved lemma in mathlib?

example (p q r : Prop) (hpr : p → r) (hqr : q → r) (h : r → (p ↔ q)) : (p ↔ q) := sorry

It's easy enough to prove, but I'm hoping there is a prepackaged version somewhere.

Matthew Ballard (Jun 21 2023 at 19:12):

aesop?

Peter Nelson (Jun 21 2023 at 19:22):

Yes, or tauto also works. But I want to use it to introduce a hypothesis r implied by both p and q to prove a p ↔ q goal in a tactic state where r doesn't yet appear. So I can't expect a tactic just to guess r, and I don't want to give the above lemma explicitly as a type annotation.

Matthew Ballard (Jun 21 2023 at 19:26):

aesop? nor exact? return any exact match

Kevin Buzzard (Jun 21 2023 at 19:38):

If you have a genuine need for this lemma then just PR it to Logic.Basic I guess.

Eric Wieser (Jun 21 2023 at 19:41):

Presumably it's worth having the marginally stronger

lemma imp_iff_iff_of_imp (p q r : Prop) (hpr : p  r) (hqr : q  r) : (r  (p  q))  (p  q) := sorry

where the reverse direction is trivial


Last updated: Dec 20 2023 at 11:08 UTC