Module docstring
{"## and ","## or "}
{"## and ","## or "}
of_eq_true
theorem
(h : p = True) : p
theorem of_eq_true (h : p = True) : p := h ▸ trivial
of_eq_false
theorem
(h : p = False) : ¬p
theorem of_eq_false (h : p = False) : ¬ p := fun hp => False.elim (h.mp hp)
implies_congr
theorem
{p₁ p₂ : Sort u} {q₁ q₂ : Sort v} (h₁ : p₁ = p₂) (h₂ : q₁ = q₂) : (p₁ → q₁) = (p₂ → q₂)
theorem implies_congr {p₁ p₂ : Sort u} {q₁ q₂ : Sort v} (h₁ : p₁ = p₂) (h₂ : q₁ = q₂) : (p₁ → q₁) = (p₂ → q₂) :=
h₁ ▸ h₂ ▸ rfl
iff_congr
theorem
{p₁ p₂ q₁ q₂ : Prop} (h₁ : p₁ ↔ p₂) (h₂ : q₁ ↔ q₂) : (p₁ ↔ q₁) ↔ (p₂ ↔ q₂)
implies_dep_congr_ctx
theorem
{p₁ p₂ q₁ : Prop} (h₁ : p₁ = p₂) {q₂ : p₂ → Prop} (h₂ : (h : p₂) → q₁ = q₂ h) : (p₁ → q₁) = ((h : p₂) → q₂ h)
theorem implies_dep_congr_ctx {p₁ p₂ q₁ : Prop} (h₁ : p₁ = p₂) {q₂ : p₂ → Prop} (h₂ : (h : p₂) → q₁ = q₂ h) : (p₁ → q₁) = ((h : p₂) → q₂ h) :=
propext ⟨
fun hl hp₂ => (h₂ hp₂).mp (hl (h₁.mpr hp₂)),
fun hr hp₁ => (h₂ (h₁.mp hp₁)).mpr (hr (h₁.mp hp₁))⟩
implies_congr_ctx
theorem
{p₁ p₂ q₁ q₂ : Prop} (h₁ : p₁ = p₂) (h₂ : p₂ → q₁ = q₂) : (p₁ → q₁) = (p₂ → q₂)
theorem implies_congr_ctx {p₁ p₂ q₁ q₂ : Prop} (h₁ : p₁ = p₂) (h₂ : p₂ → q₁ = q₂) : (p₁ → q₁) = (p₂ → q₂) :=
implies_dep_congr_ctx h₁ h₂
forall_congr
theorem
{α : Sort u} {p q : α → Prop} (h : ∀ a, p a = q a) : (∀ a, p a) = (∀ a, q a)
theorem forall_congr {α : Sort u} {p q : α → Prop} (h : ∀ a, p a = q a) : (∀ a, p a) = (∀ a, q a) :=
(funext h : p = q) ▸ rfl
forall_prop_domain_congr
theorem
{p₁ p₂ : Prop} {q₁ : p₁ → Prop} {q₂ : p₂ → Prop} (h₁ : p₁ = p₂) (h₂ : ∀ a : p₂, q₁ (h₁.substr a) = q₂ a) :
(∀ a : p₁, q₁ a) = (∀ a : p₂, q₂ a)
theorem forall_prop_domain_congr {p₁ p₂ : Prop} {q₁ : p₁ → Prop} {q₂ : p₂ → Prop}
(h₁ : p₁ = p₂)
(h₂ : ∀ a : p₂, q₁ (h₁.substr a) = q₂ a)
: (∀ a : p₁, q₁ a) = (∀ a : p₂, q₂ a) := by
subst h₁; simp [← h₂]
forall_prop_congr_dom
theorem
{p₁ p₂ : Prop} (h : p₁ = p₂) (q : p₁ → Prop) : (∀ a : p₁, q a) = (∀ a : p₂, q (h.substr a))
theorem forall_prop_congr_dom {p₁ p₂ : Prop} (h : p₁ = p₂) (q : p₁ → Prop) :
(∀ a : p₁, q a) = (∀ a : p₂, q (h.substr a)) :=
h ▸ rfl
pi_congr
theorem
{α : Sort u} {β β' : α → Sort v} (h : ∀ a, β a = β' a) : (∀ a, β a) = ∀ a, β' a
let_congr
theorem
{α : Sort u} {β : Sort v} {a a' : α} {b b' : α → β} (h₁ : a = a') (h₂ : ∀ x, b x = b' x) :
(let x := a;
b x) =
(let x := a';
b' x)
let_val_congr
theorem
{α : Sort u} {β : Sort v} {a a' : α} (b : α → β) (h : a = a') :
(let x := a;
b x) =
(let x := a';
b x)
theorem let_val_congr {α : Sort u} {β : Sort v} {a a' : α}
(b : α → β) (h : a = a') : (let x := a; b x) = (let x := a'; b x) := h ▸ rfl
let_body_congr
theorem
{α : Sort u} {β : α → Sort v} {b b' : (a : α) → β a} (a : α) (h : ∀ x, b x = b' x) :
(let x := a;
b x) =
(let x := a;
b' x)
theorem let_body_congr {α : Sort u} {β : α → Sort v} {b b' : (a : α) → β a}
(a : α) (h : ∀ x, b x = b' x) : (let x := a; b x) = (let x := a; b' x) :=
(funext h : b = b') ▸ rfl
letFun_unused
theorem
{α : Sort u} {β : Sort v} (a : α) {b b' : β} (h : b = b') : @letFun α (fun _ => β) a (fun _ => b) = b'
theorem letFun_unused {α : Sort u} {β : Sort v} (a : α) {b b' : β} (h : b = b') : @letFun α (fun _ => β) a (fun _ => b) = b' :=
h
letFun_congr
theorem
{α : Sort u} {β : Sort v} {a a' : α} {f f' : α → β} (h₁ : a = a') (h₂ : ∀ x, f x = f' x) :
@letFun α (fun _ => β) a f = @letFun α (fun _ => β) a' f'
theorem letFun_congr {α : Sort u} {β : Sort v} {a a' : α} {f f' : α → β} (h₁ : a = a') (h₂ : ∀ x, f x = f' x)
: @letFun α (fun _ => β) a f = @letFun α (fun _ => β) a' f' := by
rw [h₁, funext h₂]
letFun_body_congr
theorem
{α : Sort u} {β : Sort v} (a : α) {f f' : α → β} (h : ∀ x, f x = f' x) :
@letFun α (fun _ => β) a f = @letFun α (fun _ => β) a f'
theorem letFun_body_congr {α : Sort u} {β : Sort v} (a : α) {f f' : α → β} (h : ∀ x, f x = f' x)
: @letFun α (fun _ => β) a f = @letFun α (fun _ => β) a f' := by
rw [funext h]
letFun_val_congr
theorem
{α : Sort u} {β : Sort v} {a a' : α} {f : α → β} (h : a = a') :
@letFun α (fun _ => β) a f = @letFun α (fun _ => β) a' f
theorem letFun_val_congr {α : Sort u} {β : Sort v} {a a' : α} {f : α → β} (h : a = a')
: @letFun α (fun _ => β) a f = @letFun α (fun _ => β) a' f := by
rw [h]
ite_congr
theorem
{x y u v : α} {s : Decidable b} [Decidable c] (h₁ : b = c) (h₂ : c → x = u) (h₃ : ¬c → y = v) : ite b x y = ite c u v
@[congr]
theorem ite_congr {x y u v : α} {s : Decidable b} [Decidable c]
(h₁ : b = c) (h₂ : c → x = u) (h₃ : ¬ c → y = v) : ite b x y = ite c u v := by
cases Decidable.em c with
| inl h => rw [if_pos h]; subst b; rw [if_pos h]; exact h₂ h
| inr h => rw [if_neg h]; subst b; rw [if_neg h]; exact h₃ h
Eq.mpr_prop
theorem
{p q : Prop} (h₁ : p = q) (h₂ : q) : p
theorem Eq.mpr_prop {p q : Prop} (h₁ : p = q) (h₂ : q) : p := h₁ ▸ h₂
Eq.mpr_not
theorem
{p q : Prop} (h₁ : p = q) (h₂ : ¬q) : ¬p
theorem Eq.mpr_not {p q : Prop} (h₁ : p = q) (h₂ : ¬q) : ¬p := h₁ ▸ h₂
dite_congr
theorem
{_ : Decidable b} [Decidable c] {x : b → α} {u : c → α} {y : ¬b → α} {v : ¬c → α} (h₁ : b = c)
(h₂ : (h : c) → x (h₁.mpr_prop h) = u h) (h₃ : (h : ¬c) → y (h₁.mpr_not h) = v h) : dite b x y = dite c u v
@[congr]
theorem dite_congr {_ : Decidable b} [Decidable c]
{x : b → α} {u : c → α} {y : ¬b → α} {v : ¬c → α}
(h₁ : b = c)
(h₂ : (h : c) → x (h₁.mpr_prop h) = u h)
(h₃ : (h : ¬c) → y (h₁.mpr_not h) = v h) :
dite b x y = dite c u v := by
cases Decidable.em c with
| inl h => rw [dif_pos h]; subst b; rw [dif_pos h]; exact h₂ h
| inr h => rw [dif_neg h]; subst b; rw [dif_neg h]; exact h₃ h
ne_eq
theorem
(a b : α) : (a ≠ b) = ¬(a = b)
ite_true
theorem
(a b : α) : (if True then a else b) = a
@[simp] theorem ite_true (a b : α) : (if True then a else b) = a := rfl
ite_false
theorem
(a b : α) : (if False then a else b) = b
@[simp] theorem ite_false (a b : α) : (if False then a else b) = b := rfl
dite_true
theorem
{α : Sort u} {t : True → α} {e : ¬True → α} : (dite True t e) = t True.intro
dite_false
theorem
{α : Sort u} {t : False → α} {e : ¬False → α} : (dite False t e) = e not_false
ite_cond_eq_true
theorem
{α : Sort u} {c : Prop} {_ : Decidable c} (a b : α) (h : c = True) : (if c then a else b) = a
theorem ite_cond_eq_true {α : Sort u} {c : Prop} {_ : Decidable c} (a b : α) (h : c = True) : (if c then a else b) = a := by simp [h]
ite_cond_eq_false
theorem
{α : Sort u} {c : Prop} {_ : Decidable c} (a b : α) (h : c = False) : (if c then a else b) = b
theorem ite_cond_eq_false {α : Sort u} {c : Prop} {_ : Decidable c} (a b : α) (h : c = False) : (if c then a else b) = b := by simp [h]
dite_cond_eq_true
theorem
{α : Sort u} {c : Prop} {_ : Decidable c} {t : c → α} {e : ¬c → α} (h : c = True) : (dite c t e) = t (of_eq_true h)
theorem dite_cond_eq_true {α : Sort u} {c : Prop} {_ : Decidable c} {t : c → α} {e : ¬ c → α} (h : c = True) : (dite c t e) = t (of_eq_true h) := by simp [h]
dite_cond_eq_false
theorem
{α : Sort u} {c : Prop} {_ : Decidable c} {t : c → α} {e : ¬c → α} (h : c = False) : (dite c t e) = e (of_eq_false h)
theorem dite_cond_eq_false {α : Sort u} {c : Prop} {_ : Decidable c} {t : c → α} {e : ¬ c → α} (h : c = False) : (dite c t e) = e (of_eq_false h) := by simp [h]
ite_self
theorem
{α : Sort u} {c : Prop} {d : Decidable c} (a : α) : ite c a a = a
and_true
theorem
(p : Prop) : (p ∧ True) = p
@[simp] theorem and_true (p : Prop) : (p ∧ True) = p := propext ⟨(·.1), (⟨·, trivial⟩)⟩
true_and
theorem
(p : Prop) : (True ∧ p) = p
@[simp] theorem true_and (p : Prop) : (TrueTrue ∧ p) = p := propext ⟨(·.2), (⟨trivial, ·⟩)⟩
instLawfulIdentityAndTrue
instance
: Std.LawfulIdentity And True
and_false
theorem
(p : Prop) : (p ∧ False) = False
false_and
theorem
(p : Prop) : (False ∧ p) = False
and_self
theorem
(p : Prop) : (p ∧ p) = p
@[simp] theorem and_self (p : Prop) : (p ∧ p) = p := propext ⟨(·.left), fun h => ⟨h, h⟩⟩
instIdempotentOpAnd
instance
: Std.IdempotentOp And
instance : Std.IdempotentOp And := ⟨and_self⟩
and_not_self
theorem
: ¬(a ∧ ¬a)
@[simp] theorem and_not_self : ¬(a ∧ ¬a) | ⟨ha, hn⟩ => absurd ha hn
not_and_self
theorem
: ¬(¬a ∧ a)
@[simp] theorem not_and_self : ¬(¬a ∧ a) := and_not_selfand_not_self ∘ And.symm
and_imp
theorem
: (a ∧ b → c) ↔ (a → b → c)
@[simp] theorem and_imp : (a ∧ b → c) ↔ (a → b → c) := ⟨fun h ha hb => h ⟨ha, hb⟩, fun h ⟨ha, hb⟩ => h ha hb⟩
not_and
theorem
: ¬(a ∧ b) ↔ (a → ¬b)
@[simp] theorem not_and : ¬(a ∧ b)¬(a ∧ b) ↔ (a → ¬b) := and_imp
or_self
theorem
(p : Prop) : (p ∨ p) = p
@[simp] theorem or_self (p : Prop) : (p ∨ p) = p := propext ⟨fun | .inl h | .inr h => h, .inl⟩
instIdempotentOpOr
instance
: Std.IdempotentOp Or
instance : Std.IdempotentOp Or := ⟨or_self⟩
or_true
theorem
(p : Prop) : (p ∨ True) = True
true_or
theorem
(p : Prop) : (True ∨ p) = True
or_false
theorem
(p : Prop) : (p ∨ False) = p
@[simp] theorem or_false (p : Prop) : (p ∨ False) = p := propext ⟨fun (.inl h) => h, .inl⟩
false_or
theorem
(p : Prop) : (False ∨ p) = p
@[simp] theorem false_or (p : Prop) : (FalseFalse ∨ p) = p := propext ⟨fun (.inr h) => h, .inr⟩
instLawfulIdentityOrFalse
instance
: Std.LawfulIdentity Or False
iff_self
theorem
(p : Prop) : (p ↔ p) = True
iff_true
theorem
(p : Prop) : (p ↔ True) = p
@[simp] theorem iff_true (p : Prop) : (p ↔ True) = p := propext ⟨(·.2 trivial), fun h => ⟨fun _ => trivial, fun _ => h⟩⟩
true_iff
theorem
(p : Prop) : (True ↔ p) = p
@[simp] theorem true_iff (p : Prop) : (TrueTrue ↔ p) = p := propext ⟨(·.1 trivial), fun h => ⟨fun _ => h, fun _ => trivial⟩⟩
iff_false
theorem
(p : Prop) : (p ↔ False) = ¬p
@[simp] theorem iff_false (p : Prop) : (p ↔ False) = ¬p := propext ⟨(·.1), (⟨·, False.elim⟩)⟩
false_iff
theorem
(p : Prop) : (False ↔ p) = ¬p
false_implies
theorem
(p : Prop) : (False → p) = True
@[simp] theorem false_implies (p : Prop) : (False → p) = True := eq_true False.elim
forall_false
theorem
(p : False → Prop) : (∀ h : False, p h) = True
@[simp] theorem forall_false (p : False → Prop) : (∀ h : False, p h) = True := eq_true (False.elim ·)
implies_true
theorem
(α : Sort u) : (α → True) = True
@[simp] theorem implies_true (α : Sort u) : (α → True) = True := eq_true fun _ => trivial
true_implies
theorem
(p : Prop) : (True → p) = p
@[simp] theorem true_implies (p : Prop) : (True → p) = p := propext ⟨(· trivial), (fun _ => ·)⟩
not_false_eq_true
theorem
: (¬False) = True
@[simp] theorem not_false_eq_true : (¬ False) = True := eq_true False.elim
not_true_eq_false
theorem
: (¬True) = False
@[simp] theorem not_true_eq_false : (¬ True) = False := by decide
not_iff_self
theorem
: ¬(¬a ↔ a)
@[simp] theorem not_iff_self : ¬(¬a ↔ a) | H => iff_not_self H.symm
and_congr_right
theorem
(h : a → (b ↔ c)) : a ∧ b ↔ a ∧ c
theorem and_congr_right (h : a → (b ↔ c)) : a ∧ ba ∧ b ↔ a ∧ c :=
Iff.intro (fun ⟨ha, hb⟩ => And.intro ha ((h ha).mp hb))
(fun ⟨ha, hb⟩ => And.intro ha ((h ha).mpr hb))
and_congr_left
theorem
(h : c → (a ↔ b)) : a ∧ c ↔ b ∧ c
theorem and_congr_left (h : c → (a ↔ b)) : a ∧ ca ∧ c ↔ b ∧ c :=
Iff.trans and_comm (Iff.trans (and_congr_right h) and_comm)
and_assoc
theorem
: (a ∧ b) ∧ c ↔ a ∧ (b ∧ c)
theorem and_assoc : (a ∧ b) ∧ c(a ∧ b) ∧ c ↔ a ∧ (b ∧ c) :=
Iff.intro (fun ⟨⟨ha, hb⟩, hc⟩ => ⟨ha, hb, hc⟩)
(fun ⟨ha, hb, hc⟩ => ⟨⟨ha, hb⟩, hc⟩)
instAssociativeAnd
instance
: Std.Associative And
instance : Std.Associative And := ⟨fun _ _ _ => propext and_assoc⟩
and_self_left
theorem
: a ∧ (a ∧ b) ↔ a ∧ b
@[simp] theorem and_self_left : a ∧ (a ∧ b)a ∧ (a ∧ b) ↔ a ∧ b := by rw [←propext and_assoc, and_self]
and_self_right
theorem
: (a ∧ b) ∧ b ↔ a ∧ b
@[simp] theorem and_self_right : (a ∧ b) ∧ b(a ∧ b) ∧ b ↔ a ∧ b := by rw [ propext and_assoc, and_self]
and_congr_right_iff
theorem
: (a ∧ b ↔ a ∧ c) ↔ (a → (b ↔ c))
@[simp] theorem and_congr_right_iff : (a ∧ b ↔ a ∧ c) ↔ (a → (b ↔ c)) :=
Iff.intro (fun h ha => by simp [ha] at h; exact h) and_congr_right
and_congr_left_iff
theorem
: (a ∧ c ↔ b ∧ c) ↔ c → (a ↔ b)
@[simp] theorem and_congr_left_iff : (a ∧ c ↔ b ∧ c) ↔ c → (a ↔ b) := by
rw [@and_comm _ c, @and_comm _ c, ← and_congr_right_iff]
and_iff_left_of_imp
theorem
(h : a → b) : (a ∧ b) ↔ a
theorem and_iff_left_of_imp (h : a → b) : (a ∧ b) ↔ a := Iff.intro And.left (fun ha => And.intro ha (h ha))
and_iff_right_of_imp
theorem
(h : b → a) : (a ∧ b) ↔ b
theorem and_iff_right_of_imp (h : b → a) : (a ∧ b) ↔ b := Iff.trans And.comm (and_iff_left_of_imp h)
and_iff_left_iff_imp
theorem
: ((a ∧ b) ↔ a) ↔ (a → b)
@[simp] theorem and_iff_left_iff_imp : ((a ∧ b) ↔ a) ↔ (a → b) := Iff.intro (And.rightAnd.right ∘ ·.mpr) and_iff_left_of_imp
and_iff_right_iff_imp
theorem
: ((a ∧ b) ↔ b) ↔ (b → a)
@[simp] theorem and_iff_right_iff_imp : ((a ∧ b) ↔ b) ↔ (b → a) := Iff.intro (And.leftAnd.left ∘ ·.mpr) and_iff_right_of_imp
iff_self_and
theorem
: (p ↔ p ∧ q) ↔ (p → q)
@[simp] theorem iff_self_and : (p ↔ p ∧ q) ↔ (p → q) := by rw [@Iff.comm p, and_iff_left_iff_imp]
iff_and_self
theorem
: (p ↔ q ∧ p) ↔ (p → q)
@[simp] theorem iff_and_self : (p ↔ q ∧ p) ↔ (p → q) := by rw [and_comm, iff_self_and]
Or.imp
theorem
(f : a → c) (g : b → d) (h : a ∨ b) : c ∨ d
Or.imp_left
theorem
(f : a → b) : a ∨ c → b ∨ c
theorem Or.imp_left (f : a → b) : a ∨ c → b ∨ c := .imp f id
Or.imp_right
theorem
(f : b → c) : a ∨ b → a ∨ c
theorem Or.imp_right (f : b → c) : a ∨ b → a ∨ c := .imp id f
or_assoc
theorem
: (a ∨ b) ∨ c ↔ a ∨ (b ∨ c)
theorem or_assoc : (a ∨ b) ∨ c(a ∨ b) ∨ c ↔ a ∨ (b ∨ c) :=
Iff.intro (.rec (.imp_right .inl) (.inr.inr ∘ .inr))
(.rec (.inl.inl ∘ .inl) (.imp_left .inr))
instAssociativeOr
instance
: Std.Associative Or
instance : Std.Associative Or := ⟨fun _ _ _ => propext or_assoc⟩
or_self_left
theorem
: a ∨ (a ∨ b) ↔ a ∨ b
@[simp] theorem or_self_left : a ∨ (a ∨ b)a ∨ (a ∨ b) ↔ a ∨ b := by rw [←propext or_assoc, or_self]
or_self_right
theorem
: (a ∨ b) ∨ b ↔ a ∨ b
@[simp] theorem or_self_right : (a ∨ b) ∨ b(a ∨ b) ∨ b ↔ a ∨ b := by rw [ propext or_assoc, or_self]
or_iff_right_of_imp
theorem
(ha : a → b) : (a ∨ b) ↔ b
theorem or_iff_right_of_imp (ha : a → b) : (a ∨ b) ↔ b := Iff.intro (Or.rec ha id) .inr
or_iff_left_of_imp
theorem
(hb : b → a) : (a ∨ b) ↔ a
theorem or_iff_left_of_imp (hb : b → a) : (a ∨ b) ↔ a := Iff.intro (Or.rec id hb) .inl
or_iff_left_iff_imp
theorem
: (a ∨ b ↔ a) ↔ (b → a)
@[simp] theorem or_iff_left_iff_imp : (a ∨ b ↔ a) ↔ (b → a) := Iff.intro (·.mp ∘ Or.inr) or_iff_left_of_imp
or_iff_right_iff_imp
theorem
: (a ∨ b ↔ b) ↔ (a → b)
@[simp] theorem or_iff_right_iff_imp : (a ∨ b ↔ b) ↔ (a → b) := by rw [or_comm, or_iff_left_iff_imp]
iff_self_or
theorem
{a b : Prop} : (a ↔ a ∨ b) ↔ (b → a)
@[simp] theorem iff_self_or {a b : Prop} : (a ↔ a ∨ b) ↔ (b → a) :=
propext (@Iff.comm _ a) ▸ @or_iff_left_iff_imp a b
iff_or_self
theorem
{a b : Prop} : (b ↔ a ∨ b) ↔ (a → b)
@[simp] theorem iff_or_self {a b : Prop} : (b ↔ a ∨ b) ↔ (a → b) :=
propext (@Iff.comm _ b) ▸ @or_iff_right_iff_imp a b
Bool.or_false
theorem
(b : Bool) : (b || false) = b
@[simp] theorem Bool.or_false (b : Bool) : (b || false) = b := by cases b <;> rfl
Bool.or_true
theorem
(b : Bool) : (b || true) = true
@[simp] theorem Bool.or_true (b : Bool) : (b || true) = true := by cases b <;> rfl
Bool.false_or
theorem
(b : Bool) : (false || b) = b
@[simp] theorem Bool.false_or (b : Bool) : (falsefalse || b) = b := by cases b <;> rfl
instLawfulIdentityBoolOrFalse
instance
: Std.LawfulIdentity (· || ·) false
instance : Std.LawfulIdentity (· || ·) false where
left_id := Bool.false_or
right_id := Bool.or_false
Bool.true_or
theorem
(b : Bool) : (true || b) = true
@[simp] theorem Bool.true_or (b : Bool) : (truetrue || b) = true := by cases b <;> rfl
Bool.or_self
theorem
(b : Bool) : (b || b) = b
@[simp] theorem Bool.or_self (b : Bool) : (b || b) = b := by cases b <;> rfl
instIdempotentOpBoolOr
instance
: Std.IdempotentOp (· || ·)
instance : Std.IdempotentOp (· || ·) := ⟨Bool.or_self⟩
Bool.or_eq_true
theorem
(a b : Bool) : ((a || b) = true) = (a = true ∨ b = true)
@[simp] theorem Bool.or_eq_true (a b : Bool) : ((a || b) = true) = (a = true ∨ b = true) := by
cases a <;> cases b <;> decide
Bool.and_false
theorem
(b : Bool) : (b && false) = false
@[simp] theorem Bool.and_false (b : Bool) : (b && false) = false := by cases b <;> rfl
Bool.and_true
theorem
(b : Bool) : (b && true) = b
@[simp] theorem Bool.and_true (b : Bool) : (b && true) = b := by cases b <;> rfl
Bool.false_and
theorem
(b : Bool) : (false && b) = false
@[simp] theorem Bool.false_and (b : Bool) : (falsefalse && b) = false := by cases b <;> rfl
Bool.true_and
theorem
(b : Bool) : (true && b) = b
@[simp] theorem Bool.true_and (b : Bool) : (truetrue && b) = b := by cases b <;> rfl
instLawfulIdentityBoolAndTrue
instance
: Std.LawfulIdentity (· && ·) true
instance : Std.LawfulIdentity (· && ·) true where
left_id := Bool.true_and
right_id := Bool.and_true
Bool.and_self
theorem
(b : Bool) : (b && b) = b
@[simp] theorem Bool.and_self (b : Bool) : (b && b) = b := by cases b <;> rfl
instIdempotentOpBoolAnd
instance
: Std.IdempotentOp (· && ·)
instance : Std.IdempotentOp (· && ·) := ⟨Bool.and_self⟩
Bool.and_eq_true
theorem
(a b : Bool) : ((a && b) = true) = (a = true ∧ b = true)
@[simp] theorem Bool.and_eq_true (a b : Bool) : ((a && b) = true) = (a = true ∧ b = true) := by
cases a <;> cases b <;> decide
Bool.and_assoc
theorem
(a b c : Bool) : (a && b && c) = (a && (b && c))
theorem Bool.and_assoc (a b c : Bool) : (a && ba && b && c) = (a && (b && c)) := by
cases a <;> cases b <;> cases c <;> decide
instAssociativeBoolAnd
instance
: Std.Associative (· && ·)
instance : Std.Associative (· && ·) := ⟨Bool.and_assoc⟩
Bool.or_assoc
theorem
(a b c : Bool) : (a || b || c) = (a || (b || c))
theorem Bool.or_assoc (a b c : Bool) : (a || ba || b || c) = (a || (b || c)) := by
cases a <;> cases b <;> cases c <;> decide
instAssociativeBoolOr
instance
: Std.Associative (· || ·)
instance : Std.Associative (· || ·) := ⟨Bool.or_assoc⟩
Bool.not_not
theorem
(b : Bool) : (!!b) = b
@[simp] theorem Bool.not_not (b : Bool) : (!!b) = b := by cases b <;> rfl
Bool.not_true
theorem
: (!true) = false
@[simp] theorem Bool.not_true : (!true) = false := by decide
Bool.not_false
theorem
: (!false) = true
@[simp] theorem Bool.not_false : (!false) = true := by decide
beq_true
theorem
(b : Bool) : (b == true) = b
beq_false
theorem
(b : Bool) : (b == false) = !b
Bool.not_eq_eq_eq_not
theorem
{a b : Bool} : ((!a) = b) ↔ (a = !b)
/--
We move `!` from the left hand side of an equality to the right hand side.
This helps confluence, and also helps combining pairs of `!`s.
-/
@[simp] theorem Bool.not_eq_eq_eq_not {a b : Bool} : ((!a) = b) ↔ (a = !b) := by
cases a <;> cases b <;> simp
Bool.not_eq_not
theorem
{a b : Bool} : ¬a = !b ↔ a = b
@[simp] theorem Bool.not_eq_not {a b : Bool} : ¬a = !b¬a = !b ↔ a = b := by
cases a <;> cases b <;> simp
Bool.not_not_eq
theorem
{a b : Bool} : ¬(!a) = b ↔ a = b
theorem Bool.not_not_eq {a b : Bool} : ¬(!a) = b¬(!a) = b ↔ a = b := by simp
Bool.not_eq_true'
theorem
(b : Bool) : ((!b) = true) = (b = false)
theorem Bool.not_eq_true' (b : Bool) : ((!b) = true) = (b = false) := by simp
Bool.not_eq_false'
theorem
(b : Bool) : ((!b) = false) = (b = true)
theorem Bool.not_eq_false' (b : Bool) : ((!b) = false) = (b = true) := by simp
Bool.not_eq_true
theorem
(b : Bool) : (¬(b = true)) = (b = false)
@[simp] theorem Bool.not_eq_true (b : Bool) : (¬(b = true)) = (b = false) := by cases b <;> decide
Bool.not_eq_false
theorem
(b : Bool) : (¬(b = false)) = (b = true)
@[simp] theorem Bool.not_eq_false (b : Bool) : (¬(b = false)) = (b = true) := by cases b <;> decide
decide_eq_true_eq
theorem
[Decidable p] : (decide p = true) = p
@[simp] theorem decide_eq_true_eq [Decidable p] : (decide p = true) = p :=
propext <| Iff.intro of_decide_eq_true decide_eq_true
decide_eq_false_iff_not
theorem
{_ : Decidable p} : (decide p = false) ↔ ¬p
@[simp] theorem decide_eq_false_iff_not {_ : Decidable p} : (decide p = false) ↔ ¬p :=
⟨of_decide_eq_false, decide_eq_false⟩
decide_not
theorem
[g : Decidable p] [h : Decidable (Not p)] : decide (Not p) = !(decide p)
@[simp] theorem decide_not [g : Decidable p] [h : Decidable (Not p)] : decide (Not p) = !(decide p) := by
cases g <;> (rename_i gp; simp [gp])
not_decide_eq_true
theorem
[h : Decidable p] : ((!decide p) = true) = ¬p
theorem not_decide_eq_true [h : Decidable p] : ((!decide p) = true) = ¬ p := by simp
heq_eq_eq
theorem
(a b : α) : HEq a b = (a = b)
cond_true
theorem
(a b : α) : cond true a b = a
cond_false
theorem
(a b : α) : cond false a b = b
@[simp] theorem cond_false (a b : α) : cond false a b = b := rfl
beq_self_eq_true
theorem
[BEq α] [LawfulBEq α] (a : α) : (a == a) = true
@[simp] theorem beq_self_eq_true [BEq α] [LawfulBEq α] (a : α) : (a == a) = true := LawfulBEq.rfl
beq_self_eq_true'
theorem
[DecidableEq α] (a : α) : (a == a) = true
theorem beq_self_eq_true' [DecidableEq α] (a : α) : (a == a) = true := by simp
bne_self_eq_false
theorem
[BEq α] [LawfulBEq α] (a : α) : (a != a) = false
bne_self_eq_false'
theorem
[DecidableEq α] (a : α) : (a != a) = false
theorem bne_self_eq_false' [DecidableEq α] (a : α) : (a != a) = false := by simp
decide_False
abbrev
@[deprecated decide_false (since := "2024-11-05")] abbrev decide_False := decide_false
decide_True
abbrev
@[deprecated decide_true (since := "2024-11-05")] abbrev decide_True := decide_true
bne_iff_ne
theorem
[BEq α] [LawfulBEq α] {a b : α} : a != b ↔ a ≠ b
@[simp] theorem bne_iff_ne [BEq α] [LawfulBEq α] {a b : α} : a != ba != b ↔ a ≠ b := by
simp [bne]; rw [← beq_iff_eq (a := a) (b := b)]; simp [-beq_iff_eq]
beq_eq_false_iff_ne
theorem
[BEq α] [LawfulBEq α] {a b : α} : (a == b) = false ↔ a ≠ b
@[simp] theorem beq_eq_false_iff_ne [BEq α] [LawfulBEq α] {a b : α} : (a == b) = false ↔ a ≠ b := by
rw [ne_eq, ← beq_iff_eq (a := a) (b := b)]
cases a == b <;> decide
bne_eq_false_iff_eq
theorem
[BEq α] [LawfulBEq α] {a b : α} : (a != b) = false ↔ a = b
@[simp] theorem bne_eq_false_iff_eq [BEq α] [LawfulBEq α] {a b : α} : (a != b) = false ↔ a = b := by
rw [bne, ← beq_iff_eq (a := a) (b := b)]
cases a == b <;> decide
Bool.beq_to_eq
theorem
(a b : Bool) : (a == b) = (a = b)
theorem Bool.beq_to_eq (a b : Bool) : (a == b) = (a = b) := by simp
Bool.not_beq_to_not_eq
theorem
(a b : Bool) : (!(a == b)) = ¬(a = b)
theorem Bool.not_beq_to_not_eq (a b : Bool) : (!(a == b)) = ¬(a = b) := by simp
Nat.le_zero_eq
theorem
(a : Nat) : (a ≤ 0) = (a = 0)
@[simp] theorem Nat.le_zero_eq (a : Nat) : (a ≤ 0) = (a = 0) :=
propext ⟨fun h => Nat.le_antisymm h (Nat.zero_le ..), fun h => by rw [h]; decide⟩