Module docstring
{"## cast and equality ","## not ","## and ","## or ","## distributivity ","## not equal ","## Ite ","## exists and forall ","## membership ","## Nonempty ","## decidable "}
{"## cast and equality ","## not ","## and ","## or ","## distributivity ","## not equal ","## Ite ","## exists and forall ","## membership ","## Nonempty ","## decidable "}
cast_cast
theorem
: ∀ (ha : α = β) (hb : β = γ) (a : α), cast hb (cast ha a) = cast (ha.trans hb) a
not_not_em
theorem
(a : Prop) : ¬¬(a ∨ ¬a)
theorem not_not_em (a : Prop) : ¬¬(a ∨ ¬a) := fun h => h (.inr (h ∘ .inl))
and_self_iff
theorem
: a ∧ a ↔ a
theorem and_self_iff : a ∧ aa ∧ a ↔ a := Iff.of_eq (and_self a)
and_not_self_iff
theorem
(a : Prop) : a ∧ ¬a ↔ False
theorem and_not_self_iff (a : Prop) : a ∧ ¬aa ∧ ¬a ↔ False := iff_false_intro and_not_self
not_and_self_iff
theorem
(a : Prop) : ¬a ∧ a ↔ False
theorem not_and_self_iff (a : Prop) : ¬a¬a ∧ a¬a ∧ a ↔ False := iff_false_intro not_and_self
And.imp
theorem
(f : a → c) (g : b → d) (h : a ∧ b) : c ∧ d
And.imp_left
theorem
(h : a → b) : a ∧ c → b ∧ c
theorem And.imp_left (h : a → b) : a ∧ c → b ∧ c := .imp h id
And.imp_right
theorem
(h : a → b) : c ∧ a → c ∧ b
theorem And.imp_right (h : a → b) : c ∧ a → c ∧ b := .imp id h
and_congr
theorem
(h₁ : a ↔ c) (h₂ : b ↔ d) : a ∧ b ↔ c ∧ d
and_congr_left'
theorem
(h : a ↔ b) : a ∧ c ↔ b ∧ c
theorem and_congr_left' (h : a ↔ b) : a ∧ ca ∧ c ↔ b ∧ c := and_congr h .rfl
and_congr_right'
theorem
(h : b ↔ c) : a ∧ b ↔ a ∧ c
theorem and_congr_right' (h : b ↔ c) : a ∧ ba ∧ b ↔ a ∧ c := and_congr .rfl h
not_and_of_not_left
theorem
(b : Prop) : ¬a → ¬(a ∧ b)
theorem not_and_of_not_left (b : Prop) : ¬a → ¬(a ∧ b) := mt And.left
not_and_of_not_right
theorem
(a : Prop) {b : Prop} : ¬b → ¬(a ∧ b)
theorem not_and_of_not_right (a : Prop) {b : Prop} : ¬b → ¬(a ∧ b) := mt And.right
and_congr_right_eq
theorem
(h : a → b = c) : (a ∧ b) = (a ∧ c)
theorem and_congr_right_eq (h : a → b = c) : (a ∧ b) = (a ∧ c) :=
propext (and_congr_right (Iff.of_eqIff.of_eq ∘ h))
and_congr_left_eq
theorem
(h : c → a = b) : (a ∧ c) = (b ∧ c)
theorem and_congr_left_eq (h : c → a = b) : (a ∧ c) = (b ∧ c) :=
propext (and_congr_left (Iff.of_eqIff.of_eq ∘ h))
and_left_comm
theorem
: a ∧ b ∧ c ↔ b ∧ a ∧ c
theorem and_left_comm : a ∧ b ∧ ca ∧ b ∧ c ↔ b ∧ a ∧ c :=
Iff.intro (fun ⟨ha, hb, hc⟩ => ⟨hb, ha, hc⟩)
(fun ⟨hb, ha, hc⟩ => ⟨ha, hb, hc⟩)
and_right_comm
theorem
: (a ∧ b) ∧ c ↔ (a ∧ c) ∧ b
theorem and_right_comm : (a ∧ b) ∧ c(a ∧ b) ∧ c ↔ (a ∧ c) ∧ b :=
Iff.intro (fun ⟨⟨ha, hb⟩, hc⟩ => ⟨⟨ha, hc⟩, hb⟩)
(fun ⟨⟨ha, hc⟩, hb⟩ => ⟨⟨ha, hb⟩, hc⟩)
and_rotate
theorem
: a ∧ b ∧ c ↔ b ∧ c ∧ a
theorem and_rotate : a ∧ b ∧ ca ∧ b ∧ c ↔ b ∧ c ∧ a := by rw [and_left_comm, @and_comm a c]
and_and_and_comm
theorem
: (a ∧ b) ∧ c ∧ d ↔ (a ∧ c) ∧ b ∧ d
theorem and_and_and_comm : (a ∧ b) ∧ c ∧ d(a ∧ b) ∧ c ∧ d ↔ (a ∧ c) ∧ b ∧ d := by rw [← and_assoc, @and_right_comm a, and_assoc]
and_and_left
theorem
: a ∧ (b ∧ c) ↔ (a ∧ b) ∧ a ∧ c
theorem and_and_left : a ∧ (b ∧ c)a ∧ (b ∧ c) ↔ (a ∧ b) ∧ a ∧ c := by rw [and_and_and_comm, and_self]
and_and_right
theorem
: (a ∧ b) ∧ c ↔ (a ∧ c) ∧ b ∧ c
theorem and_and_right : (a ∧ b) ∧ c(a ∧ b) ∧ c ↔ (a ∧ c) ∧ b ∧ c := by rw [and_and_and_comm, and_self]
and_iff_left
theorem
(hb : b) : a ∧ b ↔ a
and_iff_right
theorem
(ha : a) : a ∧ b ↔ b
or_self_iff
theorem
: a ∨ a ↔ a
theorem or_self_iff : a ∨ aa ∨ a ↔ a := or_self _ ▸ .rfl
not_or_intro
theorem
{a b : Prop} (ha : ¬a) (hb : ¬b) : ¬(a ∨ b)
theorem not_or_intro {a b : Prop} (ha : ¬a) (hb : ¬b) : ¬(a ∨ b) := (·.elim ha hb)
or_congr
theorem
(h₁ : a ↔ c) (h₂ : b ↔ d) : (a ∨ b) ↔ (c ∨ d)
theorem or_congr (h₁ : a ↔ c) (h₂ : b ↔ d) : (a ∨ b) ↔ (c ∨ d) := ⟨.imp h₁.mp h₂.mp, .imp h₁.mpr h₂.mpr⟩
or_congr_left
theorem
(h : a ↔ b) : a ∨ c ↔ b ∨ c
theorem or_congr_left (h : a ↔ b) : a ∨ ca ∨ c ↔ b ∨ c := or_congr h .rfl
or_congr_right
theorem
(h : b ↔ c) : a ∨ b ↔ a ∨ c
theorem or_congr_right (h : b ↔ c) : a ∨ ba ∨ b ↔ a ∨ c := or_congr .rfl h
or_left_comm
theorem
: a ∨ (b ∨ c) ↔ b ∨ (a ∨ c)
theorem or_left_comm : a ∨ (b ∨ c)a ∨ (b ∨ c) ↔ b ∨ (a ∨ c) := by rw [← or_assoc, ← or_assoc, @or_comm a b]
or_right_comm
theorem
: (a ∨ b) ∨ c ↔ (a ∨ c) ∨ b
theorem or_right_comm : (a ∨ b) ∨ c(a ∨ b) ∨ c ↔ (a ∨ c) ∨ b := by rw [or_assoc, or_assoc, @or_comm b]
or_or_or_comm
theorem
: (a ∨ b) ∨ c ∨ d ↔ (a ∨ c) ∨ b ∨ d
theorem or_or_or_comm : (a ∨ b) ∨ c ∨ d(a ∨ b) ∨ c ∨ d ↔ (a ∨ c) ∨ b ∨ d := by rw [← or_assoc, @or_right_comm a, or_assoc]
or_or_distrib_left
theorem
: a ∨ b ∨ c ↔ (a ∨ b) ∨ a ∨ c
theorem or_or_distrib_left : a ∨ b ∨ ca ∨ b ∨ c ↔ (a ∨ b) ∨ a ∨ c := by rw [or_or_or_comm, or_self]
or_or_distrib_right
theorem
: (a ∨ b) ∨ c ↔ (a ∨ c) ∨ b ∨ c
theorem or_or_distrib_right : (a ∨ b) ∨ c(a ∨ b) ∨ c ↔ (a ∨ c) ∨ b ∨ c := by rw [or_or_or_comm, or_self]
or_rotate
theorem
: a ∨ b ∨ c ↔ b ∨ c ∨ a
theorem or_rotate : a ∨ b ∨ ca ∨ b ∨ c ↔ b ∨ c ∨ a := by simp only [or_left_comm, Or.comm]
or_iff_left
theorem
(hb : ¬b) : a ∨ b ↔ a
theorem or_iff_left (hb : ¬b) : a ∨ ba ∨ b ↔ a := or_iff_left_iff_imp.mpr hb.elim
or_iff_right
theorem
(ha : ¬a) : a ∨ b ↔ b
theorem or_iff_right (ha : ¬a) : a ∨ ba ∨ b ↔ b := or_iff_right_iff_imp.mpr ha.elim
not_imp_of_and_not
theorem
: a ∧ ¬b → ¬(a → b)
theorem not_imp_of_and_not : a ∧ ¬b → ¬(a → b)
| ⟨ha, hb⟩, h => hb <| h ha
imp_and
theorem
{α} : (α → b ∧ c) ↔ (α → b) ∧ (α → c)
theorem imp_and {α} : (α → b ∧ c) ↔ (α → b) ∧ (α → c) :=
⟨fun h => ⟨fun ha => (h ha).1, fun ha => (h ha).2⟩, fun h ha => ⟨h.1 ha, h.2 ha⟩⟩
not_and'
theorem
: ¬(a ∧ b) ↔ b → ¬a
theorem not_and' : ¬(a ∧ b)¬(a ∧ b) ↔ b → ¬a := Iff.trans not_and imp_not_comm
and_or_left
theorem
: a ∧ (b ∨ c) ↔ (a ∧ b) ∨ (a ∧ c)
/-- `∧` distributes over `∨` (on the left). -/
theorem and_or_left : a ∧ (b ∨ c)a ∧ (b ∨ c) ↔ (a ∧ b) ∨ (a ∧ c) :=
Iff.intro (fun ⟨ha, hbc⟩ => hbc.imp (.intro ha) (.intro ha))
(Or.rec (.imp_right .inl) (.imp_right .inr))
or_and_right
theorem
: (a ∨ b) ∧ c ↔ (a ∧ c) ∨ (b ∧ c)
/-- `∧` distributes over `∨` (on the right). -/
theorem or_and_right : (a ∨ b) ∧ c(a ∨ b) ∧ c ↔ (a ∧ c) ∨ (b ∧ c) := by rw [@and_comm (a ∨ b), and_or_left, @and_comm c, @and_comm c]
or_and_left
theorem
: a ∨ (b ∧ c) ↔ (a ∨ b) ∧ (a ∨ c)
/-- `∨` distributes over `∧` (on the left). -/
theorem or_and_left : a ∨ (b ∧ c)a ∨ (b ∧ c) ↔ (a ∨ b) ∧ (a ∨ c) :=
Iff.intro (Or.rec (fun ha => ⟨.inl ha, .inl ha⟩) (.imp .inr .inr))
(And.rec <| .rec (fun _ => .inl ·) (.imp_right.imp_right ∘ .intro))
and_or_right
theorem
: (a ∧ b) ∨ c ↔ (a ∨ c) ∧ (b ∨ c)
/-- `∨` distributes over `∧` (on the right). -/
theorem and_or_right : (a ∧ b) ∨ c(a ∧ b) ∨ c ↔ (a ∨ c) ∧ (b ∨ c) := by rw [@or_comm (a ∧ b), or_and_left, @or_comm c, @or_comm c]
or_imp
theorem
: (a ∨ b → c) ↔ (a → c) ∧ (b → c)
theorem or_imp : (a ∨ b → c) ↔ (a → c) ∧ (b → c) :=
Iff.intro (fun h => ⟨h ∘ .inl, h ∘ .inr⟩) (fun ⟨ha, hb⟩ => Or.rec ha hb)
not_or
theorem
: ¬(p ∨ q) ↔ ¬p ∧ ¬q
@[simp] theorem not_or : ¬(p ∨ q)¬(p ∨ q) ↔ ¬p ∧ ¬q := or_imp
not_and_of_not_or_not
theorem
(h : ¬a ∨ ¬b) : ¬(a ∧ b)
ne_of_apply_ne
theorem
{α β : Sort _} (f : α → β) {x y : α} : f x ≠ f y → x ≠ y
theorem ne_of_apply_ne {α β : Sort _} (f : α → β) {x y : α} : f x ≠ f y → x ≠ y :=
mt <| congrArg _
if_false_left
theorem
[h : Decidable p] : ite p False q ↔ ¬p ∧ q
@[simp]
theorem if_false_left [h : Decidable p] :
iteite p False q ↔ ¬p ∧ q := by cases h <;> (rename_i g; simp [g])
if_false_right
theorem
[h : Decidable p] : ite p q False ↔ p ∧ q
@[simp]
theorem if_false_right [h : Decidable p] :
iteite p q False ↔ p ∧ q := by cases h <;> (rename_i g; simp [g])
if_true_left
theorem
[h : Decidable p] : ite p True q ↔ ¬p → q
@[simp low]
theorem if_true_left [h : Decidable p] :
iteite p True q ↔ ¬p → q := by cases h <;> (rename_i g; simp [g])
if_true_right
theorem
[h : Decidable p] : ite p q True ↔ p → q
@[simp low]
theorem if_true_right [h : Decidable p] :
iteite p q True ↔ p → q := by cases h <;> (rename_i g; simp [g])
dite_not
theorem
[hn : Decidable (¬p)] [h : Decidable p] (x : ¬p → α) (y : ¬¬p → α) :
dite (¬p) x y = dite p (fun h => y (not_not_intro h)) x
ite_not
theorem
(p : Prop) [Decidable p] (x y : α) : ite (¬p) x y = ite p y x
ite_then_self
theorem
{p q : Prop} [h : Decidable p] : (if p then p else q) ↔ (¬p → q)
@[simp] theorem ite_then_self {p q : Prop} [h : Decidable p] : (if p then p else q) ↔ (¬p → q) := by
cases h <;> (rename_i g; simp [g])
ite_else_self
theorem
{p q : Prop} [h : Decidable p] : (if p then q else p) ↔ (p ∧ q)
@[simp] theorem ite_else_self {p q : Prop} [h : Decidable p] : (if p then q else p) ↔ (p ∧ q) := by
cases h <;> (rename_i g; simp [g])
ite_then_not_self
theorem
{p : Prop} [Decidable p] {q : Prop} : (if p then ¬p else q) ↔ ¬p ∧ q
@[simp] theorem ite_then_not_self {p : Prop} [Decidable p] {q : Prop} : (if p then ¬p else q) ↔ ¬p ∧ q := by
split <;> simp_all
ite_else_not_self
theorem
{p : Prop} [Decidable p] {q : Prop} : (if p then q else ¬p) ↔ p → q
@[simp] theorem ite_else_not_self {p : Prop} [Decidable p] {q : Prop} : (if p then q else ¬p) ↔ p → q := by
split <;> simp_all
ite_eq_ite
theorem
(p : Prop) {h h' : Decidable p} (x y : α) : (@ite _ p h x y = @ite _ p h' x y) ↔ True
/-- If two if-then-else statements only differ by the `Decidable` instances, they are equal. -/
-- This is useful for ensuring confluence, but rarely otherwise.
@[simp] theorem ite_eq_ite (p : Prop) {h h' : Decidable p} (x y : α) :
(@ite _ p h x y = @ite _ p h' x y) ↔ True := by
simp
congr
ite_iff_ite
theorem
(p : Prop) {h h' : Decidable p} (x y : Prop) : (@ite _ p h x y ↔ @ite _ p h' x y) ↔ True
/-- If two if-then-else statements only differ by the `Decidable` instances, they are equal. -/
-- This is useful for ensuring confluence, but rarely otherwise.
@[simp] theorem ite_iff_ite (p : Prop) {h h' : Decidable p} (x y : Prop) :
(@ite _ p h x y ↔ @ite _ p h' x y) ↔ True := by
rw [iff_true]
suffices @ite _ p h x y = @ite _ p h' x y by simp [this]
congr
forall_imp
theorem
(h : ∀ a, p a → q a) : (∀ a, p a) → ∀ a, q a
theorem forall_imp (h : ∀ a, p a → q a) : (∀ a, p a) → ∀ a, q a := fun h' a => h a (h' a)
forall_exists_index
theorem
{q : (∃ x, p x) → Prop} : (∀ h, q h) ↔ ∀ x (h : p x), q ⟨x, h⟩
/--
As `simp` does not index foralls, this `@[simp]` lemma is tried on every `forall` expression.
This is not ideal, and likely a performance issue, but it is difficult to remove this attribute at this time.
-/
@[simp] theorem forall_exists_index {q : (∃ x, p x) → Prop} :
(∀ h, q h) ↔ ∀ x (h : p x), q ⟨x, h⟩ :=
⟨fun h x hpx => h ⟨x, hpx⟩, fun h ⟨x, hpx⟩ => h x hpx⟩
Exists.imp
theorem
(h : ∀ a, p a → q a) : (∃ a, p a) → ∃ a, q a
theorem Exists.imp (h : ∀ a, p a → q a) : (∃ a, p a) → ∃ a, q a
| ⟨a, hp⟩ => ⟨a, h a hp⟩
Exists.imp'
theorem
{β} {q : β → Prop} (f : α → β) (hpq : ∀ a, p a → q (f a)) : (∃ a, p a) → ∃ b, q b
theorem Exists.imp' {β} {q : β → Prop} (f : α → β) (hpq : ∀ a, p a → q (f a)) :
(∃ a, p a) → ∃ b, q b
| ⟨_, hp⟩ => ⟨_, hpq _ hp⟩
exists_imp
theorem
: ((∃ x, p x) → b) ↔ ∀ x, p x → b
theorem exists_imp : ((∃ x, p x) → b) ↔ ∀ x, p x → b := forall_exists_index
exists₂_imp
theorem
{P : (x : α) → p x → Prop} : (∃ x h, P x h) → b ↔ ∀ x h, P x h → b
theorem exists₂_imp {P : (x : α) → p x → Prop} : (∃ x h, P x h) → b ↔ ∀ x h, P x h → b := by simp
exists_const
theorem
(α) [i : Nonempty α] : (∃ _ : α, b) ↔ b
@[simp] theorem exists_const (α) [i : Nonempty α] : (∃ _ : α, b) ↔ b :=
⟨fun ⟨_, h⟩ => h, i.elim Exists.intro⟩
exists_prop_congr
theorem
{p p' : Prop} {q q' : p → Prop} (hq : ∀ h, q h ↔ q' h) (hp : p ↔ p') : Exists q ↔ ∃ h : p', q' (hp.2 h)
@[congr]
theorem exists_prop_congr {p p' : Prop} {q q' : p → Prop} (hq : ∀ h, q h ↔ q' h) (hp : p ↔ p') :
ExistsExists q ↔ ∃ h : p', q' (hp.2 h) :=
⟨fun ⟨_, _⟩ ↦ ⟨hp.1 ‹_›, (hq _).1 ‹_›⟩, fun ⟨_, _⟩ ↦ ⟨_, (hq _).2 ‹_›⟩⟩
exists_prop_of_true
theorem
{p : Prop} {q : p → Prop} (h : p) : (Exists fun h' : p => q h') ↔ q h
theorem exists_prop_of_true {p : Prop} {q : p → Prop} (h : p) : (Exists fun h' : p => q h') ↔ q h :=
@exists_const (q h) p ⟨h⟩
exists_true_left
theorem
{p : True → Prop} : Exists p ↔ p True.intro
@[simp] theorem exists_true_left {p : True → Prop} : ExistsExists p ↔ p True.intro :=
exists_prop_of_true _
forall_congr'
theorem
(h : ∀ a, p a ↔ q a) : (∀ a, p a) ↔ ∀ a, q a
theorem forall_congr' (h : ∀ a, p a ↔ q a) : (∀ a, p a) ↔ ∀ a, q a :=
⟨fun H a => (h a).1 (H a), fun H a => (h a).2 (H a)⟩
exists_congr
theorem
(h : ∀ a, p a ↔ q a) : (∃ a, p a) ↔ ∃ a, q a
theorem exists_congr (h : ∀ a, p a ↔ q a) : (∃ a, p a) ↔ ∃ a, q a :=
⟨Exists.imp fun x => (h x).1, Exists.imp fun x => (h x).2⟩
forall₂_congr
theorem
{p q : ∀ a, β a → Prop} (h : ∀ a b, p a b ↔ q a b) : (∀ a b, p a b) ↔ ∀ a b, q a b
theorem forall₂_congr {p q : ∀ a, β a → Prop} (h : ∀ a b, p a b ↔ q a b) :
(∀ a b, p a b) ↔ ∀ a b, q a b :=
forall_congr' fun a => forall_congr' <| h a
exists₂_congr
theorem
{p q : ∀ a, β a → Prop} (h : ∀ a b, p a b ↔ q a b) : (∃ a b, p a b) ↔ ∃ a b, q a b
theorem exists₂_congr {p q : ∀ a, β a → Prop} (h : ∀ a b, p a b ↔ q a b) :
(∃ a b, p a b) ↔ ∃ a b, q a b :=
exists_congr fun a => exists_congr <| h a
forall₃_congr
theorem
{p q : ∀ a b, γ a b → Prop} (h : ∀ a b c, p a b c ↔ q a b c) : (∀ a b c, p a b c) ↔ ∀ a b c, q a b c
theorem forall₃_congr {p q : ∀ a b, γ a b → Prop} (h : ∀ a b c, p a b c ↔ q a b c) :
(∀ a b c, p a b c) ↔ ∀ a b c, q a b c :=
forall_congr' fun a => forall₂_congr <| h a
exists₃_congr
theorem
{p q : ∀ a b, γ a b → Prop} (h : ∀ a b c, p a b c ↔ q a b c) : (∃ a b c, p a b c) ↔ ∃ a b c, q a b c
theorem exists₃_congr {p q : ∀ a b, γ a b → Prop} (h : ∀ a b c, p a b c ↔ q a b c) :
(∃ a b c, p a b c) ↔ ∃ a b c, q a b c :=
exists_congr fun a => exists₂_congr <| h a
forall₄_congr
theorem
{p q : ∀ a b c, δ a b c → Prop} (h : ∀ a b c d, p a b c d ↔ q a b c d) : (∀ a b c d, p a b c d) ↔ ∀ a b c d, q a b c d
theorem forall₄_congr {p q : ∀ a b c, δ a b c → Prop} (h : ∀ a b c d, p a b c d ↔ q a b c d) :
(∀ a b c d, p a b c d) ↔ ∀ a b c d, q a b c d :=
forall_congr' fun a => forall₃_congr <| h a
exists₄_congr
theorem
{p q : ∀ a b c, δ a b c → Prop} (h : ∀ a b c d, p a b c d ↔ q a b c d) : (∃ a b c d, p a b c d) ↔ ∃ a b c d, q a b c d
theorem exists₄_congr {p q : ∀ a b c, δ a b c → Prop} (h : ∀ a b c d, p a b c d ↔ q a b c d) :
(∃ a b c d, p a b c d) ↔ ∃ a b c d, q a b c d :=
exists_congr fun a => exists₃_congr <| h a
forall₅_congr
theorem
{p q : ∀ a b c d, ε a b c d → Prop} (h : ∀ a b c d e, p a b c d e ↔ q a b c d e) :
(∀ a b c d e, p a b c d e) ↔ ∀ a b c d e, q a b c d e
theorem forall₅_congr {p q : ∀ a b c d, ε a b c d → Prop}
(h : ∀ a b c d e, p a b c d e ↔ q a b c d e) :
(∀ a b c d e, p a b c d e) ↔ ∀ a b c d e, q a b c d e :=
forall_congr' fun a => forall₄_congr <| h a
exists₅_congr
theorem
{p q : ∀ a b c d, ε a b c d → Prop} (h : ∀ a b c d e, p a b c d e ↔ q a b c d e) :
(∃ a b c d e, p a b c d e) ↔ ∃ a b c d e, q a b c d e
theorem exists₅_congr {p q : ∀ a b c d, ε a b c d → Prop}
(h : ∀ a b c d e, p a b c d e ↔ q a b c d e) :
(∃ a b c d e, p a b c d e) ↔ ∃ a b c d e, q a b c d e :=
exists_congr fun a => exists₄_congr <| h a
not_exists
theorem
: (¬∃ x, p x) ↔ ∀ x, ¬p x
@[simp] theorem not_exists : (¬∃ x, p x) ↔ ∀ x, ¬p x := exists_imp
forall_not_of_not_exists
theorem
(h : ¬∃ x, p x) : ∀ x, ¬p x
theorem forall_not_of_not_exists (h : ¬∃ x, p x) : ∀ x, ¬p x := not_exists.mp h
not_exists_of_forall_not
theorem
(h : ∀ x, ¬p x) : ¬∃ x, p x
theorem not_exists_of_forall_not (h : ∀ x, ¬p x) : ¬∃ x, p x := not_exists.mpr h
forall_and
theorem
: (∀ x, p x ∧ q x) ↔ (∀ x, p x) ∧ (∀ x, q x)
exists_or
theorem
: (∃ x, p x ∨ q x) ↔ (∃ x, p x) ∨ ∃ x, q x
exists_false
theorem
: ¬(∃ _a : α, False)
@[simp] theorem exists_false : ¬(∃ _a : α, False) := fun ⟨_, h⟩ => h
forall_const
theorem
(α : Sort _) [i : Nonempty α] : (α → b) ↔ b
@[simp] theorem forall_const (α : Sort _) [i : Nonempty α] : (α → b) ↔ b :=
⟨i.elim, fun hb _ => hb⟩
Exists.nonempty
theorem
: (∃ x, p x) → Nonempty α
theorem Exists.nonempty : (∃ x, p x) → Nonempty α | ⟨x, _⟩ => ⟨x⟩
not_forall_of_exists_not
theorem
{p : α → Prop} : (∃ x, ¬p x) → ¬∀ x, p x
theorem not_forall_of_exists_not {p : α → Prop} : (∃ x, ¬p x) → ¬∀ x, p x
| ⟨x, hn⟩, h => hn (h x)
forall_eq
theorem
{p : α → Prop} {a' : α} : (∀ a, a = a' → p a) ↔ p a'
@[simp] theorem forall_eq {p : α → Prop} {a' : α} : (∀ a, a = a' → p a) ↔ p a' :=
⟨fun h => h a' rfl, fun h _ e => e.symm ▸ h⟩
forall_eq'
theorem
{a' : α} : (∀ a, a' = a → p a) ↔ p a'
@[simp] theorem forall_eq' {a' : α} : (∀ a, a' = a → p a) ↔ p a' := by simp [@eq_comm _ a']
exists_eq
theorem
: ∃ a, a = a'
@[simp] theorem exists_eq : ∃ a, a = a' := ⟨_, rfl⟩
exists_eq'
theorem
: ∃ a, a' = a
@[simp] theorem exists_eq' : ∃ a, a' = a := ⟨_, rfl⟩
exists_eq_left
theorem
: (∃ a, a = a' ∧ p a) ↔ p a'
@[simp] theorem exists_eq_left : (∃ a, a = a' ∧ p a) ↔ p a' :=
⟨fun ⟨_, e, h⟩ => e ▸ h, fun h => ⟨_, rfl, h⟩⟩
exists_eq_right
theorem
: (∃ a, p a ∧ a = a') ↔ p a'
@[simp] theorem exists_eq_right : (∃ a, p a ∧ a = a') ↔ p a' :=
(exists_congr <| by exact fun a => And.comm).trans exists_eq_left
exists_and_left
theorem
: (∃ x, b ∧ p x) ↔ b ∧ (∃ x, p x)
@[simp] theorem exists_and_left : (∃ x, b ∧ p x) ↔ b ∧ (∃ x, p x) :=
⟨fun ⟨x, h, hp⟩ => ⟨h, x, hp⟩, fun ⟨h, x, hp⟩ => ⟨x, h, hp⟩⟩
exists_and_right
theorem
: (∃ x, p x ∧ b) ↔ (∃ x, p x) ∧ b
@[simp] theorem exists_and_right : (∃ x, p x ∧ b) ↔ (∃ x, p x) ∧ b := by simp [And.comm]
exists_eq_left'
theorem
: (∃ a, a' = a ∧ p a) ↔ p a'
@[simp] theorem exists_eq_left' : (∃ a, a' = a ∧ p a) ↔ p a' := by simp [@eq_comm _ a']
exists_eq_right'
theorem
: (∃ a, p a ∧ a' = a) ↔ p a'
@[simp] theorem exists_eq_right' : (∃ a, p a ∧ a' = a) ↔ p a' := by simp [@eq_comm _ a']
forall_eq_or_imp
theorem
: (∀ a, a = a' ∨ q a → p a) ↔ p a' ∧ ∀ a, q a → p a
@[simp] theorem forall_eq_or_imp : (∀ a, a = a' ∨ q a → p a) ↔ p a' ∧ ∀ a, q a → p a := by
simp only [or_imp, forall_and, forall_eq]
exists_eq_or_imp
theorem
: (∃ a, (a = a' ∨ q a) ∧ p a) ↔ p a' ∨ ∃ a, q a ∧ p a
@[simp] theorem exists_eq_or_imp : (∃ a, (a = a' ∨ q a) ∧ p a) ↔ p a' ∨ ∃ a, q a ∧ p a := by
simp only [or_and_right, exists_or, exists_eq_left]
exists_eq_right_right
theorem
: (∃ (a : α), p a ∧ q a ∧ a = a') ↔ p a' ∧ q a'
@[simp] theorem exists_eq_right_right : (∃ (a : α), p a ∧ q a ∧ a = a') ↔ p a' ∧ q a' := by
simp [← and_assoc]
exists_eq_right_right'
theorem
: (∃ (a : α), p a ∧ q a ∧ a' = a) ↔ p a' ∧ q a'
@[simp] theorem exists_eq_right_right' : (∃ (a : α), p a ∧ q a ∧ a' = a) ↔ p a' ∧ q a' := by
simp [@eq_comm _ a']
exists_or_eq_left
theorem
(y : α) (p : α → Prop) : ∃ x : α, x = y ∨ p x
@[simp] theorem exists_or_eq_left (y : α) (p : α → Prop) : ∃ x : α, x = y ∨ p x := ⟨y, .inl rfl⟩
exists_or_eq_right
theorem
(y : α) (p : α → Prop) : ∃ x : α, p x ∨ x = y
@[simp] theorem exists_or_eq_right (y : α) (p : α → Prop) : ∃ x : α, p x ∨ x = y := ⟨y, .inr rfl⟩
exists_or_eq_left'
theorem
(y : α) (p : α → Prop) : ∃ x : α, y = x ∨ p x
@[simp] theorem exists_or_eq_left' (y : α) (p : α → Prop) : ∃ x : α, y = x ∨ p x := ⟨y, .inl rfl⟩
exists_or_eq_right'
theorem
(y : α) (p : α → Prop) : ∃ x : α, p x ∨ y = x
@[simp] theorem exists_or_eq_right' (y : α) (p : α → Prop) : ∃ x : α, p x ∨ y = x := ⟨y, .inr rfl⟩
exists_prop'
theorem
{p : Prop} : (∃ _ : α, p) ↔ Nonempty α ∧ p
theorem exists_prop' {p : Prop} : (∃ _ : α, p) ↔ Nonempty α ∧ p :=
⟨fun ⟨a, h⟩ => ⟨⟨a⟩, h⟩, fun ⟨⟨a⟩, h⟩ => ⟨a, h⟩⟩
exists_prop
theorem
: (∃ _h : a, b) ↔ a ∧ b
@[simp] theorem exists_prop : (∃ _h : a, b) ↔ a ∧ b :=
⟨fun ⟨hp, hq⟩ => ⟨hp, hq⟩, fun ⟨hp, hq⟩ => ⟨hp, hq⟩⟩
exists_idem
theorem
{P : Prop} (f : P → P → Sort _) : (∃ (p₁ : P), ∃ (p₂ : P), f p₁ p₂) ↔ ∃ (p : P), f p p
@[simp] theorem exists_idem {P : Prop} (f : P → P → Sort _) :
(∃ (p₁ : P), ∃ (p₂ : P), f p₁ p₂) ↔ ∃ (p : P), f p p :=
⟨fun ⟨p, _, h⟩ => ⟨p, h⟩, fun ⟨p, h⟩ => ⟨p, p, h⟩⟩
exists_apply_eq_apply
theorem
(f : α → β) (a' : α) : ∃ a, f a = f a'
@[simp] theorem exists_apply_eq_apply (f : α → β) (a' : α) : ∃ a, f a = f a' := ⟨a', rfl⟩
forall_prop_of_true
theorem
{p : Prop} {q : p → Prop} (h : p) : (∀ h' : p, q h') ↔ q h
theorem forall_prop_of_true {p : Prop} {q : p → Prop} (h : p) : (∀ h' : p, q h') ↔ q h :=
@forall_const (q h) p ⟨h⟩
forall_comm
theorem
{p : α → β → Prop} : (∀ a b, p a b) ↔ (∀ b a, p a b)
theorem forall_comm {p : α → β → Prop} : (∀ a b, p a b) ↔ (∀ b a, p a b) :=
⟨fun h b a => h a b, fun h a b => h b a⟩
exists_comm
theorem
{p : α → β → Prop} : (∃ a b, p a b) ↔ (∃ b a, p a b)
theorem exists_comm {p : α → β → Prop} : (∃ a b, p a b) ↔ (∃ b a, p a b) :=
⟨fun ⟨a, b, h⟩ => ⟨b, a, h⟩, fun ⟨b, a, h⟩ => ⟨a, b, h⟩⟩
forall_apply_eq_imp_iff
theorem
{f : α → β} {p : β → Prop} : (∀ b a, f a = b → p b) ↔ ∀ a, p (f a)
@[simp] theorem forall_apply_eq_imp_iff {f : α → β} {p : β → Prop} :
(∀ b a, f a = b → p b) ↔ ∀ a, p (f a) := by simp [forall_comm]
forall_eq_apply_imp_iff
theorem
{f : α → β} {p : β → Prop} : (∀ b a, b = f a → p b) ↔ ∀ a, p (f a)
@[simp] theorem forall_eq_apply_imp_iff {f : α → β} {p : β → Prop} :
(∀ b a, b = f a → p b) ↔ ∀ a, p (f a) := by simp [forall_comm]
forall_apply_eq_imp_iff₂
theorem
{f : α → β} {p : α → Prop} {q : β → Prop} : (∀ b a, p a → f a = b → q b) ↔ ∀ a, p a → q (f a)
@[simp] theorem forall_apply_eq_imp_iff₂ {f : α → β} {p : α → Prop} {q : β → Prop} :
(∀ b a, p a → f a = b → q b) ↔ ∀ a, p a → q (f a) :=
⟨fun h a ha => h (f a) a ha rfl, fun h _ a ha hb => hb ▸ h a ha⟩
forall_prop_of_false
theorem
{p : Prop} {q : p → Prop} (hn : ¬p) : (∀ h' : p, q h') ↔ True
theorem forall_prop_of_false {p : Prop} {q : p → Prop} (hn : ¬p) : (∀ h' : p, q h') ↔ True :=
iff_true_intro fun h => hn.elim h
and_exists_self
theorem
(P : Prop) (Q : P → Prop) : (P ∧ ∃ p, Q p) ↔ ∃ p, Q p
@[simp] theorem and_exists_self (P : Prop) (Q : P → Prop) : (P ∧ ∃ p, Q p) ↔ ∃ p, Q p :=
⟨fun ⟨_, h⟩ => h, fun ⟨p, q⟩ => ⟨p, ⟨p, q⟩⟩⟩
exists_and_self
theorem
(P : Prop) (Q : P → Prop) : ((∃ p, Q p) ∧ P) ↔ ∃ p, Q p
@[simp] theorem exists_and_self (P : Prop) (Q : P → Prop) : ((∃ p, Q p) ∧ P) ↔ ∃ p, Q p :=
⟨fun ⟨h, _⟩ => h, fun ⟨p, q⟩ => ⟨⟨p, q⟩, p⟩⟩
forall_self_imp
theorem
(P : Prop) (Q : P → Prop) : (∀ p : P, P → Q p) ↔ ∀ p, Q p
@[simp] theorem forall_self_imp (P : Prop) (Q : P → Prop) : (∀ p : P, P → Q p) ↔ ∀ p, Q p :=
⟨fun h p => h p p, fun h _ p => h p⟩
ne_of_mem_of_not_mem
theorem
(h : a ∈ s) : b ∉ s → a ≠ b
theorem ne_of_mem_of_not_mem (h : a ∈ s) : b ∉ s → a ≠ b := mt fun e => e ▸ h
ne_of_mem_of_not_mem'
theorem
(h : a ∈ s) : a ∉ t → s ≠ t
theorem ne_of_mem_of_not_mem' (h : a ∈ s) : a ∉ t → s ≠ t := mt fun e => e ▸ h
nonempty_prop
theorem
{p : Prop} : Nonempty p ↔ p
@[simp] theorem nonempty_prop {p : Prop} : NonemptyNonempty p ↔ p :=
⟨fun ⟨h⟩ => h, fun h => ⟨h⟩⟩
Decidable.not_not
theorem
[Decidable p] : ¬¬p ↔ p
@[simp] theorem Decidable.not_not [Decidable p] : ¬¬p¬¬p ↔ p := ⟨of_not_not, not_not_intro⟩
Decidable.or_not_self
abbrev
/-- Excluded middle. Added as alias for Decidable.em -/
abbrev Decidable.or_not_self := em
Decidable.not_or_self
theorem
(p : Prop) [h : Decidable p] : ¬p ∨ p
/-- Excluded middle commuted. Added as alias for Decidable.em -/
theorem Decidable.not_or_self (p : Prop) [h : Decidable p] : ¬p¬p ∨ p := by
cases h <;> simp [*]
Decidable.by_contra
theorem
[Decidable p] : (¬p → False) → p
theorem Decidable.by_contra [Decidable p] : (¬p → False) → p := of_not_not
Or.by_cases
definition
[Decidable p] {α : Sort u} (h : p ∨ q) (h₁ : p → α) (h₂ : q → α) : α
/-- Construct a non-Prop by cases on an `Or`, when the left conjunct is decidable. -/
protected def Or.by_cases [Decidable p] {α : Sort u} (h : p ∨ q) (h₁ : p → α) (h₂ : q → α) : α :=
if hp : p then h₁ hp else h₂ (h.resolve_left hp)
Or.by_cases'
definition
[Decidable q] {α : Sort u} (h : p ∨ q) (h₁ : p → α) (h₂ : q → α) : α
/-- Construct a non-Prop by cases on an `Or`, when the right conjunct is decidable. -/
protected def Or.by_cases' [Decidable q] {α : Sort u} (h : p ∨ q) (h₁ : p → α) (h₂ : q → α) : α :=
if hq : q then h₂ hq else h₁ (h.resolve_right hq)
exists_prop_decidable
instance
{p} (P : p → Prop) [Decidable p] [∀ h, Decidable (P h)] : Decidable (∃ h, P h)
instance exists_prop_decidable {p} (P : p → Prop)
[Decidable p] [∀ h, Decidable (P h)] : Decidable (∃ h, P h) :=
if h : p then
decidable_of_decidable_of_iff ⟨fun h2 => ⟨h, h2⟩, fun ⟨_, h2⟩ => h2⟩
else isFalse fun ⟨h', _⟩ => h h'
forall_prop_decidable
instance
{p} (P : p → Prop) [Decidable p] [∀ h, Decidable (P h)] : Decidable (∀ h, P h)
instance forall_prop_decidable {p} (P : p → Prop)
[Decidable p] [∀ h, Decidable (P h)] : Decidable (∀ h, P h) :=
if h : p then
decidable_of_decidable_of_iff ⟨fun h2 _ => h2, fun al => al h⟩
else isTrue fun h2 => absurd h2 h
decide_eq_true_iff
theorem
{p : Prop} [Decidable p] : (decide p = true) ↔ p
@[bool_to_prop] theorem decide_eq_true_iff {p : Prop} [Decidable p] : (decide p = true) ↔ p := by simp
decide_eq_decide
theorem
{p q : Prop} {_ : Decidable p} {_ : Decidable q} : decide p = decide q ↔ (p ↔ q)
@[simp, bool_to_prop] theorem decide_eq_decide {p q : Prop} {_ : Decidable p} {_ : Decidable q} :
decidedecide p = decide q ↔ (p ↔ q) :=
⟨fun h => by rw [← decide_eq_true_iff (p := p), h, decide_eq_true_iff], fun h => by simp [h]⟩
Decidable.of_not_imp
theorem
[Decidable a] (h : ¬(a → b)) : a
theorem Decidable.of_not_imp [Decidable a] (h : ¬(a → b)) : a :=
byContradiction (not_not_of_not_imp h)
Decidable.not_imp_symm
theorem
[Decidable a] (h : ¬a → b) (hb : ¬b) : a
theorem Decidable.not_imp_symm [Decidable a] (h : ¬a → b) (hb : ¬b) : a :=
byContradiction <| hb ∘ h
Decidable.not_imp_comm
theorem
[Decidable a] [Decidable b] : (¬a → b) ↔ (¬b → a)
theorem Decidable.not_imp_comm [Decidable a] [Decidable b] : (¬a → b) ↔ (¬b → a) :=
⟨not_imp_symm, not_imp_symm⟩
Decidable.not_imp_self
theorem
[Decidable a] : (¬a → a) ↔ a
theorem Decidable.not_imp_self [Decidable a] : (¬a → a) ↔ a := by
have := @imp_not_self (¬a); rwa [not_not] at this
Decidable.or_iff_not_imp_left
theorem
[Decidable a] : a ∨ b ↔ (¬a → b)
theorem Decidable.or_iff_not_imp_left [Decidable a] : a ∨ ba ∨ b ↔ (¬a → b) :=
⟨Or.resolve_left, fun h => dite _ .inl (.inr ∘ h)⟩
Decidable.or_iff_not_imp_right
theorem
[Decidable b] : a ∨ b ↔ (¬b → a)
theorem Decidable.or_iff_not_imp_right [Decidable b] : a ∨ ba ∨ b ↔ (¬b → a) :=
or_comm.trans or_iff_not_imp_left
Decidable.not_imp_not
theorem
[Decidable a] : (¬a → ¬b) ↔ (b → a)
theorem Decidable.not_imp_not [Decidable a] : (¬a → ¬b) ↔ (b → a) :=
⟨fun h hb => byContradiction (h · hb), mt⟩
Decidable.not_or_of_imp
theorem
[Decidable a] (h : a → b) : ¬a ∨ b
theorem Decidable.not_or_of_imp [Decidable a] (h : a → b) : ¬a¬a ∨ b :=
if ha : a then .inr (h ha) else .inl ha
Decidable.imp_iff_not_or
theorem
[Decidable a] : (a → b) ↔ (¬a ∨ b)
theorem Decidable.imp_iff_not_or [Decidable a] : (a → b) ↔ (¬a ∨ b) :=
⟨not_or_of_imp, Or.neg_resolve_left⟩
Decidable.imp_iff_or_not
theorem
[Decidable b] : b → a ↔ a ∨ ¬b
theorem Decidable.imp_iff_or_not [Decidable b] : b → a ↔ a ∨ ¬b :=
Decidable.imp_iff_not_or.trans or_comm
Decidable.imp_or
theorem
[Decidable a] : (a → b ∨ c) ↔ (a → b) ∨ (a → c)
Decidable.imp_or'
theorem
[Decidable b] : (a → b ∨ c) ↔ (a → b) ∨ (a → c)
Decidable.not_imp_iff_and_not
theorem
[Decidable a] : ¬(a → b) ↔ a ∧ ¬b
theorem Decidable.not_imp_iff_and_not [Decidable a] : ¬(a → b)¬(a → b) ↔ a ∧ ¬b :=
⟨fun h => ⟨of_not_imp h, not_of_not_imp h⟩, not_imp_of_and_not⟩
Decidable.peirce
theorem
(a b : Prop) [Decidable a] : ((a → b) → a) → a
theorem Decidable.peirce (a b : Prop) [Decidable a] : ((a → b) → a) → a :=
if ha : a then fun _ => ha else fun h => h ha.elim
peirce'
theorem
{a : Prop} (H : ∀ b : Prop, (a → b) → a) : a
Decidable.not_iff_not
theorem
[Decidable a] [Decidable b] : (¬a ↔ ¬b) ↔ (a ↔ b)
theorem Decidable.not_iff_not [Decidable a] [Decidable b] : (¬a ↔ ¬b) ↔ (a ↔ b) := by
rw [@iff_def (¬a), @iff_def' a]; exact and_congr not_imp_not not_imp_not
Decidable.not_iff_comm
theorem
[Decidable a] [Decidable b] : (¬a ↔ b) ↔ (¬b ↔ a)
theorem Decidable.not_iff_comm [Decidable a] [Decidable b] : (¬a ↔ b) ↔ (¬b ↔ a) := by
rw [@iff_def (¬a), @iff_def (¬b)]; exact and_congr not_imp_comm imp_not_comm
Decidable.not_iff
theorem
[Decidable b] : ¬(a ↔ b) ↔ (¬a ↔ b)
Decidable.iff_not_comm
theorem
[Decidable a] [Decidable b] : (a ↔ ¬b) ↔ (b ↔ ¬a)
theorem Decidable.iff_not_comm [Decidable a] [Decidable b] : (a ↔ ¬b) ↔ (b ↔ ¬a) := by
rw [@iff_def a, @iff_def b]; exact and_congr imp_not_comm not_imp_comm
Decidable.iff_iff_and_or_not_and_not
theorem
{a b : Prop} [Decidable b] : (a ↔ b) ↔ (a ∧ b) ∨ (¬a ∧ ¬b)
Decidable.iff_iff_not_or_and_or_not
theorem
[Decidable a] [Decidable b] : (a ↔ b) ↔ (¬a ∨ b) ∧ (a ∨ ¬b)
theorem Decidable.iff_iff_not_or_and_or_not [Decidable a] [Decidable b] :
(a ↔ b) ↔ (¬a ∨ b) ∧ (a ∨ ¬b) := by
rw [iff_iff_implies_and_implies (a := a) (b := b)]; simp only [imp_iff_not_or, Or.comm]
Decidable.not_and_not_right
theorem
[Decidable b] : ¬(a ∧ ¬b) ↔ (a → b)
Decidable.not_and_iff_not_or_not
theorem
[Decidable a] : ¬(a ∧ b) ↔ ¬a ∨ ¬b
Decidable.not_and_iff_or_not_not
abbrev
@[deprecated Decidable.not_and_iff_not_or_not (since := "2025-03-18")]
abbrev Decidable.not_and_iff_or_not_not := @Decidable.not_and_iff_not_or_not
Decidable.not_and_iff_not_or_not'
theorem
[Decidable b] : ¬(a ∧ b) ↔ ¬a ∨ ¬b
Decidable.not_and_iff_or_not_not'
abbrev
@[deprecated Decidable.not_and_iff_not_or_not' (since := "2025-03-18")]
abbrev Decidable.not_and_iff_or_not_not' := @Decidable.not_and_iff_not_or_not'
Decidable.or_iff_not_not_and_not
theorem
[Decidable a] [Decidable b] : a ∨ b ↔ ¬(¬a ∧ ¬b)
theorem Decidable.or_iff_not_not_and_not [Decidable a] [Decidable b] : a ∨ ba ∨ b ↔ ¬(¬a ∧ ¬b) := by
rw [← not_or, not_not]
Decidable.or_iff_not_and_not
abbrev
@[deprecated Decidable.or_iff_not_not_and_not (since := "2025-03-18")]
abbrev Decidable.or_iff_not_and_not := @Decidable.or_iff_not_not_and_not
Decidable.and_iff_not_not_or_not
theorem
[Decidable a] [Decidable b] : a ∧ b ↔ ¬(¬a ∨ ¬b)
theorem Decidable.and_iff_not_not_or_not [Decidable a] [Decidable b] : a ∧ ba ∧ b ↔ ¬(¬a ∨ ¬b) := by
rw [← not_and_iff_not_or_not, not_not]
Decidable.and_iff_not_or_not
abbrev
@[deprecated Decidable.and_iff_not_not_or_not (since := "2025-03-18")]
abbrev Decidable.and_iff_not_or_not := @Decidable.and_iff_not_not_or_not
Decidable.imp_iff_right_iff
theorem
[Decidable a] : (a → b ↔ b) ↔ a ∨ b
theorem Decidable.imp_iff_right_iff [Decidable a] : (a → b ↔ b) ↔ a ∨ b :=
Iff.intro
(fun h => (Decidable.em a).imp_right fun ha' => h.mp fun ha => (ha' ha).elim)
(fun ab => ab.elim imp_iff_right fun hb => iff_of_true (fun _ => hb) hb)
Decidable.imp_iff_left_iff
theorem
[Decidable a] : (b ↔ a → b) ↔ a ∨ b
theorem Decidable.imp_iff_left_iff [Decidable a] : (b ↔ a → b) ↔ a ∨ b :=
propext (@Iff.comm (a → b) b) ▸ (@Decidable.imp_iff_right_iff a b _)
Decidable.and_or_imp
theorem
[Decidable a] : a ∧ b ∨ (a → c) ↔ a → b ∨ c
Decidable.or_congr_left'
theorem
[Decidable c] (h : ¬c → (a ↔ b)) : a ∨ c ↔ b ∨ c
theorem Decidable.or_congr_left' [Decidable c] (h : ¬c → (a ↔ b)) : a ∨ ca ∨ c ↔ b ∨ c := by
rw [or_iff_not_imp_right, or_iff_not_imp_right]; exact imp_congr_right h
Decidable.or_congr_right'
theorem
[Decidable a] (h : ¬a → (b ↔ c)) : a ∨ b ↔ a ∨ c
theorem Decidable.or_congr_right' [Decidable a] (h : ¬a → (b ↔ c)) : a ∨ ba ∨ b ↔ a ∨ c := by
rw [or_iff_not_imp_left, or_iff_not_imp_left]; exact imp_congr_right h
Decidable.iff_congr_left
theorem
{P Q R : Prop} [Decidable P] [Decidable Q] [Decidable R] : ((P ↔ R) ↔ (Q ↔ R)) ↔ (P ↔ Q)
@[simp] theorem Decidable.iff_congr_left {P Q R : Prop} [Decidable P] [Decidable Q] [Decidable R] :
((P ↔ R) ↔ (Q ↔ R)) ↔ (P ↔ Q) :=
if h : R then by simp_all [Decidable.not_iff_not] else by simp_all [Decidable.not_iff_not]
Decidable.iff_congr_right
theorem
{P Q R : Prop} [Decidable P] [Decidable Q] [Decidable R] : ((P ↔ Q) ↔ (P ↔ R)) ↔ (Q ↔ R)
@[simp] theorem Decidable.iff_congr_right {P Q R : Prop} [Decidable P] [Decidable Q] [Decidable R] :
((P ↔ Q) ↔ (P ↔ R)) ↔ (Q ↔ R) :=
if h : P then by simp_all [Decidable.not_iff_not] else by simp_all [Decidable.not_iff_not]
decidable_of_iff
definition
(a : Prop) (h : a ↔ b) [Decidable a] : Decidable b
/-- Transfer decidability of `a` to decidability of `b`, if the propositions are equivalent.
**Important**: this function should be used instead of `rw` on `Decidable b`, because the
kernel will get stuck reducing the usage of `propext` otherwise,
and `decide` will not work. -/
@[inline] def decidable_of_iff (a : Prop) (h : a ↔ b) [Decidable a] : Decidable b :=
decidable_of_decidable_of_iff h
decidable_of_iff'
definition
(b : Prop) (h : a ↔ b) [Decidable b] : Decidable a
/-- Transfer decidability of `b` to decidability of `a`, if the propositions are equivalent.
This is the same as `decidable_of_iff` but the iff is flipped. -/
@[inline] def decidable_of_iff' (b : Prop) (h : a ↔ b) [Decidable b] : Decidable a :=
decidable_of_decidable_of_iff h.symm
Decidable.predToBool
instance
(p : α → Prop) [DecidablePred p] : CoeDep (α → Prop) p (α → Bool)
instance Decidable.predToBool (p : α → Prop) [DecidablePred p] :
CoeDep (α → Prop) p (α → Bool) := ⟨fun b => decide <| p b⟩
instDecidablePredComp
instance
[DecidablePred p] : DecidablePred (p ∘ f)
instance [DecidablePred p] : DecidablePred (p ∘ f) :=
fun x => inferInstanceAs (Decidable (p (f x)))
decidable_of_bool
definition
: ∀ (b : Bool), (b ↔ a) → Decidable a
/-- Prove that `a` is decidable by constructing a boolean `b` and a proof that `b ↔ a`.
(This is sometimes taken as an alternate definition of decidability.) -/
def decidable_of_bool : ∀ (b : Bool), (b ↔ a) → Decidable a
| true, h => isTrue (h.1 rfl)
| false, h => isFalse (mt h.2 Bool.noConfusion)
Decidable.not_forall
theorem
{p : α → Prop} [Decidable (∃ x, ¬p x)] [∀ x, Decidable (p x)] : (¬∀ x, p x) ↔ ∃ x, ¬p x
protected theorem Decidable.not_forall {p : α → Prop} [Decidable (∃ x, ¬p x)]
[∀ x, Decidable (p x)] : (¬∀ x, p x) ↔ ∃ x, ¬p x :=
⟨Decidable.not_imp_symm fun nx x => Decidable.not_imp_symm (fun h => ⟨x, h⟩) nx,
not_forall_of_exists_not⟩
Decidable.not_forall_not
theorem
{p : α → Prop} [Decidable (∃ x, p x)] : (¬∀ x, ¬p x) ↔ ∃ x, p x
protected theorem Decidable.not_forall_not {p : α → Prop} [Decidable (∃ x, p x)] :
(¬∀ x, ¬p x) ↔ ∃ x, p x :=
(@Decidable.not_iff_comm _ _ _ (decidable_of_iff (¬∃ x, p x) not_exists)).1 not_exists
Decidable.not_exists_not
theorem
{p : α → Prop} [∀ x, Decidable (p x)] : (¬∃ x, ¬p x) ↔ ∀ x, p x
protected theorem Decidable.not_exists_not {p : α → Prop} [∀ x, Decidable (p x)] :
(¬∃ x, ¬p x) ↔ ∀ x, p x := by
simp only [not_exists, Decidable.not_not]
decide_implies
theorem
(u v : Prop) [duv : Decidable (u → v)] [du : Decidable u] {dv : u → Decidable v} :
decide (u → v) = dite u (fun h => @decide v (dv h)) (fun _ => true)
@[simp]
theorem decide_implies (u v : Prop)
[duv : Decidable (u → v)] [du : Decidable u] {dv : u → Decidable v}
: decide (u → v) = dite u (fun h => @decide v (dv h)) (fun _ => true) :=
if h : u then by
simp [h]
else by
simp [h]
decide_ite
theorem
(u : Prop) [du : Decidable u] (p q : Prop) [dpq : Decidable (ite u p q)] [dp : Decidable p] [dq : Decidable q] :
decide (ite u p q) = ite u (decide p) (decide q)
ite_then_decide_self
theorem
(p : Prop) [h : Decidable p] {w : Decidable p} (q : Bool) : (@ite _ p h (decide p) q) = (decide p || q)
@[simp] theorem ite_then_decide_self (p : Prop) [h : Decidable p] {w : Decidable p} (q : Bool) :
(@ite _ p h (decide p) q) = (decidedecide p || q) := by
split <;> simp_all
ite_else_decide_self
theorem
(p : Prop) [h : Decidable p] {w : Decidable p} (q : Bool) : (@ite _ p h q (decide p)) = (decide p && q)
@[simp] theorem ite_else_decide_self (p : Prop) [h : Decidable p] {w : Decidable p} (q : Bool) :
(@ite _ p h q (decide p)) = (decidedecide p && q) := by
split <;> simp_all
ite_then_decide_not_self
theorem
(p : Prop) [h : Decidable p] {w : Decidable p} (q : Bool) : (@ite _ p h (!decide p) q) = (!decide p && q)
@[simp] theorem ite_then_decide_not_self (p : Prop) [h : Decidable p] {w : Decidable p} (q : Bool) :
(@ite _ p h (!decide p) q) = (!decide p!decide p && q) := by
split <;> simp_all
ite_else_decide_not_self
theorem
(p : Prop) [h : Decidable p] {w : Decidable p} (q : Bool) : (@ite _ p h q (!decide p)) = (!decide p || q)
@[simp] theorem ite_else_decide_not_self (p : Prop) [h : Decidable p] {w : Decidable p} (q : Bool) :
(@ite _ p h q (!decide p)) = (!decide p!decide p || q) := by
split <;> simp_all
dite_eq_left_iff
theorem
{p : Prop} [Decidable p] {x : α} {y : ¬p → α} : (if h : p then x else y h) = x ↔ ∀ h : ¬p, y h = x
@[simp] theorem dite_eq_left_iff {p : Prop} [Decidable p] {x : α} {y : ¬ p → α} : (if h : p then x else y h) = x ↔ ∀ h : ¬ p, y h = x := by
split <;> simp_all
dite_eq_right_iff
theorem
{p : Prop} [Decidable p] {x : p → α} {y : α} : (if h : p then x h else y) = y ↔ ∀ h : p, x h = y
@[simp] theorem dite_eq_right_iff {p : Prop} [Decidable p] {x : p → α} {y : α} : (if h : p then x h else y) = y ↔ ∀ h : p, x h = y := by
split <;> simp_all
dite_iff_left_iff
theorem
{p : Prop} [Decidable p] {x : Prop} {y : ¬p → Prop} : ((if h : p then x else y h) ↔ x) ↔ ∀ h : ¬p, y h ↔ x
@[simp] theorem dite_iff_left_iff {p : Prop} [Decidable p] {x : Prop} {y : ¬ p → Prop} : ((if h : p then x else y h) ↔ x) ↔ ∀ h : ¬ p, y h ↔ x := by
split <;> simp_all
dite_iff_right_iff
theorem
{p : Prop} [Decidable p] {x : p → Prop} {y : Prop} : ((if h : p then x h else y) ↔ y) ↔ ∀ h : p, x h ↔ y
@[simp] theorem dite_iff_right_iff {p : Prop} [Decidable p] {x : p → Prop} {y : Prop} : ((if h : p then x h else y) ↔ y) ↔ ∀ h : p, x h ↔ y := by
split <;> simp_all
ite_eq_left_iff
theorem
{p : Prop} [Decidable p] {x y : α} : (if p then x else y) = x ↔ ¬p → y = x
@[simp] theorem ite_eq_left_iff {p : Prop} [Decidable p] {x y : α} : (if p then x else y) = x ↔ ¬ p → y = x := by
split <;> simp_all
ite_eq_right_iff
theorem
{p : Prop} [Decidable p] {x y : α} : (if p then x else y) = y ↔ p → x = y
@[simp] theorem ite_eq_right_iff {p : Prop} [Decidable p] {x y : α} : (if p then x else y) = y ↔ p → x = y := by
split <;> simp_all
ite_iff_left_iff
theorem
{p : Prop} [Decidable p] {x y : Prop} : ((if p then x else y) ↔ x) ↔ ¬p → y = x
@[simp] theorem ite_iff_left_iff {p : Prop} [Decidable p] {x y : Prop} : ((if p then x else y) ↔ x) ↔ ¬ p → y = x := by
split <;> simp_all
ite_iff_right_iff
theorem
{p : Prop} [Decidable p] {x y : Prop} : ((if p then x else y) ↔ y) ↔ p → x = y
@[simp] theorem ite_iff_right_iff {p : Prop} [Decidable p] {x y : Prop} : ((if p then x else y) ↔ y) ↔ p → x = y := by
split <;> simp_all
dite_then_false
theorem
{p : Prop} [Decidable p] {x : ¬p → Prop} : (if h : p then False else x h) ↔ ∃ h : ¬p, x h
@[simp] theorem dite_then_false {p : Prop} [Decidable p] {x : ¬ p → Prop} : (if h : p then False else x h) ↔ ∃ h : ¬ p, x h := by
split <;> simp_all
dite_else_false
theorem
{p : Prop} [Decidable p] {x : p → Prop} : (if h : p then x h else False) ↔ ∃ h : p, x h
@[simp] theorem dite_else_false {p : Prop} [Decidable p] {x : p → Prop} : (if h : p then x h else False) ↔ ∃ h : p, x h := by
split <;> simp_all
dite_then_true
theorem
{p : Prop} [Decidable p] {x : ¬p → Prop} : (if h : p then True else x h) ↔ ∀ h : ¬p, x h
@[simp] theorem dite_then_true {p : Prop} [Decidable p] {x : ¬ p → Prop} : (if h : p then True else x h) ↔ ∀ h : ¬ p, x h := by
split <;> simp_all
dite_else_true
theorem
{p : Prop} [Decidable p] {x : p → Prop} : (if h : p then x h else True) ↔ ∀ h : p, x h
@[simp] theorem dite_else_true {p : Prop} [Decidable p] {x : p → Prop} : (if h : p then x h else True) ↔ ∀ h : p, x h := by
split <;> simp_all