Skip to content

Commit

Permalink
feat(logic/lemmas): (∀ p, f p) ↔ f true ∧ f false (#17944)
Browse files Browse the repository at this point in the history
Expand quantifiers over `Prop`
  • Loading branch information
YaelDillies committed Dec 15, 2022
1 parent a59dad5 commit 4237da0
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/logic/lemmas.lean
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ Copyright (c) 2022 Yaël Dillies. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Yaël Dillies
-/
import tactic.congr
import tactic.protected
import tactic.rcases
import tactic.split_ifs
import logic.basic

Expand Down Expand Up @@ -63,3 +65,9 @@ dite_dite_distrib_left

lemma ite_ite_distrib_right : ite p (ite q a b) c = ite q (ite p a c) (ite p b c) :=
dite_dite_distrib_right

lemma Prop.forall {f : PropProp} : (∀ p, f p) ↔ f true ∧ f false :=
⟨λ h, ⟨h _, h _⟩, by { rintro ⟨h₁, h₀⟩ p, by_cases hp : p; simp only [hp]; assumption }⟩

lemma Prop.exists {f : PropProp} : (∃ p, f p) ↔ f true ∨ f false :=
⟨λ ⟨p, h⟩, by refine (em p).imp _ _; intro H; convert h; simp [H], by rintro (h | h); exact ⟨_, h⟩⟩

0 comments on commit 4237da0

Please sign in to comment.