Built with
doc-gen4, running Lean4.
Bubbles (
) indicate interactive fragments: hover for details, tap to reveal contents.
Use
Ctrl+↑Ctrl+↓to navigate,
Ctrl+🖱️to focus.
On Mac, use
Cmdinstead of
Ctrl.
/-
Copyright (c) 2017 Microsoft Corporation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Leonardo de Moura
-/
import Std.Logic
import Mathlib.Init.Logic
/-! Lemmas use by the congruence closure module -/
theorem iff_eq_of_eq_true_left: ∀ {a b : Prop}, a = True → (a ↔ b) = b
iff_eq_of_eq_true_left {a b : Prop} (h : a = True) : (a ↔ b) = b :=
h.symm: ∀ {α : Sort ?u.16} {a b : α}, a = b → b = a
symm ▸ propext: ∀ {a b : Prop}, (a ↔ b) → a = b
propext true_iff_iff
theorem iff_eq_of_eq_true_right: ∀ {a b : Prop}, b = True → (a ↔ b) = a
iff_eq_of_eq_true_right {a b : Prop} (h : b = True) : (a ↔ b) = a :=
h.symm: ∀ {α : Sort ?u.58} {a b : α}, a = b → b = a
symm ▸ propext: ∀ {a b : Prop}, (a ↔ b) → a = b
propext iff_true_iff
theorem iff_eq_true_of_eq: ∀ {a b : Prop}, a = b → (a ↔ b) = True
iff_eq_true_of_eq {a b : Prop} (h : a = b) : (a ↔ b) = True :=
h ▸ propext: ∀ {a b : Prop}, (a ↔ b) → a = b
propext (iff_self_iff _)
theorem and_eq_of_eq_true_left: ∀ {a b : Prop}, a = True → (a ∧ b) = b
and_eq_of_eq_true_left {a b : Prop} (h : a = True) : (a ∧ b) = b :=
h.symm: ∀ {α : Sort ?u.134} {a b : α}, a = b → b = a
symm ▸ propext: ∀ {a b : Prop}, (a ↔ b) → a = b
propext (true_and_iff _)
theorem and_eq_of_eq_true_right: ∀ {a b : Prop}, b = True → (a ∧ b) = a
and_eq_of_eq_true_right {a b : Prop} (h : b = True) : (a ∧ b) = a :=
h.symm: ∀ {α : Sort ?u.178} {a b : α}, a = b → b = a
symm ▸ propext: ∀ {a b : Prop}, (a ↔ b) → a = b
propext (and_true_iff _)
theorem and_eq_of_eq_false_left {a b : Prop} (h : a = False) : (a ∧ b) = False :=
h.symm: ∀ {α : Sort ?u.222} {a b : α}, a = b → b = a
symm ▸ propext: ∀ {a b : Prop}, (a ↔ b) → a = b
propext (false_and_iff _)
theorem and_eq_of_eq_false_right {a b : Prop} (h : b = False) : (a ∧ b) = False :=
h.symm: ∀ {α : Sort ?u.266} {a b : α}, a = b → b = a
symm ▸ propext: ∀ {a b : Prop}, (a ↔ b) → a = b
propext (and_false_iff _)
theorem and_eq_of_eq: ∀ {a b : Prop}, a = b → (a ∧ b) = a
and_eq_of_eq {a b : Prop} (h : a = b) : (a ∧ b) = a :=
h ▸ propext: ∀ {a b : Prop}, (a ↔ b) → a = b
propext (and_self_iff: ∀ (p : Prop), p ∧ p ↔ p
and_self_iff _)
theorem or_eq_of_eq_true_left {a b : Prop} (h : a = True) : (a ∨ b) = True :=
h.symm: ∀ {α : Sort ?u.346} {a b : α}, a = b → b = a
symm ▸ propext: ∀ {a b : Prop}, (a ↔ b) → a = b
propext (true_or_iff _)
theorem or_eq_of_eq_true_right {a b : Prop} (h : b = True) : (a ∨ b) = True :=
h.symm: ∀ {α : Sort ?u.390} {a b : α}, a = b → b = a
symm ▸ propext: ∀ {a b : Prop}, (a ↔ b) → a = b
propext (or_true_iff _)
theorem or_eq_of_eq_false_left: ∀ {a b : Prop}, a = False → (a ∨ b) = b
or_eq_of_eq_false_left {a b : Prop} (h : a = False) : (a ∨ b) = b :=
h.symm: ∀ {α : Sort ?u.434} {a b : α}, a = b → b = a
symm ▸ propext: ∀ {a b : Prop}, (a ↔ b) → a = b
propext (false_or_iff _)
theorem or_eq_of_eq_false_right: ∀ {a b : Prop}, b = False → (a ∨ b) = a
or_eq_of_eq_false_right {a b : Prop} (h : b = False) : (a ∨ b) = a :=
h.symm: ∀ {α : Sort ?u.478} {a b : α}, a = b → b = a
symm ▸ propext: ∀ {a b : Prop}, (a ↔ b) → a = b
propext (or_false_iff _)
theorem or_eq_of_eq: ∀ {a b : Prop}, a = b → (a ∨ b) = a
or_eq_of_eq {a b : Prop} (h : a = b) : (a ∨ b) = a :=
h ▸ propext: ∀ {a b : Prop}, (a ↔ b) → a = b
propext (or_self_iff: ∀ (p : Prop), p ∨ p ↔ p
or_self_iff _)
theorem imp_eq_of_eq_true_left: ∀ {a b : Prop}, a = True → (a → b) = b
imp_eq_of_eq_true_left {a b : Prop} (h : a = True) : (a → b) = b :=
h.symm: ∀ {α : Sort ?u.561} {a b : α}, a = b → b = a
symm ▸ propext: ∀ {a b : Prop}, (a ↔ b) → a = b
propext ⟨fun h ↦ h trivial, fun h₁ _ ↦ h₁⟩
theorem imp_eq_of_eq_true_right {a b : Prop} (h : b = True) : (a → b) = True :=
h.symm: ∀ {α : Sort ?u.633} {a b : α}, a = b → b = a
symm ▸ propext: ∀ {a b : Prop}, (a ↔ b) → a = b
propext ⟨fun _ ↦ trivial, fun h₁ _ ↦ h₁⟩
theorem imp_eq_of_eq_false_left {a b : Prop} (h : a = False) : (a → b) = True :=
h.symm: ∀ {α : Sort ?u.705} {a b : α}, a = b → b = a
symm ▸ propext: ∀ {a b : Prop}, (a ↔ b) → a = b
propext ⟨fun _ ↦ trivial, fun _ h₂ ↦ False.elim h₂⟩
theorem imp_eq_of_eq_false_right: ∀ {a b : Prop}, b = False → (a → b) = ¬a
imp_eq_of_eq_false_right {a b : Prop} (h : b = False) : (a → b) = Not a :=
h.symm: ∀ {α : Sort ?u.779} {a b : α}, a = b → b = a
symm ▸ propext: ∀ {a b : Prop}, (a ↔ b) → a = b
propext ⟨fun h ↦ h, fun hna ha ↦ hna ha⟩
/- Remark: the congruence closure module will only use the following lemma is
cc_config.em is tt. -/
theorem not_imp_eq_of_eq_false_right: ∀ {a b : Prop}, b = False → (¬a → b) = a
not_imp_eq_of_eq_false_right {a b : Prop} (h : b = False) : (Not a → b) = a :=
h.symm: ∀ {α : Sort ?u.852} {a b : α}, a = b → b = a
symm ▸ propext: ∀ {a b : Prop}, (a ↔ b) → a = b
propext (Iff.intro: ∀ {a b : Prop}, (a → b) → (b → a) → (a ↔ b)
Iff.intro (
fun h' ↦ Classical.byContradiction: ∀ {p : Prop}, (¬p → False) → p
Classical.byContradiction fun hna ↦ h' hna) fun ha hna ↦ hna ha)
theorem imp_eq_true_of_eq: ∀ {a b : Prop}, a = b → (a → b) = True
imp_eq_true_of_eq {a b : Prop} (h : a = b) : (a → b) = True :=
h ▸ propext: ∀ {a b : Prop}, (a ↔ b) → a = b
propext ⟨fun _ ↦ trivial, fun _ ha ↦ ha⟩
theorem not_eq_of_eq_true {a : Prop} (h : a = True) : Not a = False :=
h.symm: ∀ {α : Sort ?u.987} {a b : α}, a = b → b = a
symm ▸ propext: ∀ {a b : Prop}, (a ↔ b) → a = b
propext not_true
theorem not_eq_of_eq_false {a : Prop} (h : a = False) : Not a = True :=
h.symm: ∀ {α : Sort ?u.1024} {a b : α}, a = b → b = a
symm ▸ propext: ∀ {a b : Prop}, (a ↔ b) → a = b
propext not_false_iff
theorem false_of_a_eq_not_a {a : Prop} (h : a = Not a) : False :=
have : Not a := fun ha ↦ absurd: ∀ {a : Prop} {b : Sort ?u.1063}, a → ¬a → b
absurd ha (Eq.mp: ∀ {α β : Sort ?u.1066}, α = β → α → β
Eq.mp h ha)
absurd: ∀ {a : Prop} {b : Sort ?u.1076}, a → ¬a → b
absurd (Eq.mpr: ∀ {α β : Sort ?u.1079}, α = β → β → α
Eq.mpr h this) this
universe u
theorem if_eq_of_eq_true {c : Prop} [d : Decidable c] {α : Sort u} (t e : α) (h : c = True) :
@ite α c d t e = t :=
if_pos: ∀ {c : Prop} {h : Decidable c}, c → ∀ {α : Sort ?u.1114} {t e : α}, (if c then t else e) = t
if_pos (of_eq_true h)
theorem if_eq_of_eq_false {c : Prop} [d : Decidable c] {α : Sort u} (t e : α) (h : c = False) :
@ite α c d t e = e :=
if_neg: ∀ {c : Prop} {h : Decidable c}, ¬c → ∀ {α : Sort ?u.1164} {t e : α}, (if c then t else e) = e
if_neg (not_of_eq_false h)
theorem if_eq_of_eq: ∀ (c : Prop) [d : Decidable c] {α : Sort u} {t e : α}, t = e → (if c then t else e) = t
if_eq_of_eq (c : Prop) [d : Decidable c] {α : Sort u} {t e : α} (h : t = e) :
@ite α c d t e = t :=
match d with
| isTrue _ => rfl: ∀ {α : Sort ?u.1231} {a : α}, a = a
rfl
| isFalse _ => Eq.symm: ∀ {α : Sort ?u.1249} {a b : α}, a = b → b = a
Eq.symm h
theorem eq_true_of_and_eq_true_left {a b : Prop} (h : (a ∧ b) = True) : a = True :=
eq_true (And.left: ∀ {a b : Prop}, a ∧ b → a
And.left (of_eq_true h))
theorem eq_true_of_and_eq_true_right {a b : Prop} (h : (a ∧ b) = True) : b = True :=
eq_true (And.right: ∀ {a b : Prop}, a ∧ b → b
And.right (of_eq_true h))
theorem eq_false_of_or_eq_false_left {a b : Prop} (h : (a ∨ b) = False) : a = False :=
eq_false fun ha ↦ False.elim (Eq.mp: ∀ {α β : Sort ?u.1403}, α = β → α → β
Eq.mp h (Or.inl: ∀ {a b : Prop}, a → a ∨ b
Or.inl ha))
theorem eq_false_of_or_eq_false_right {a b : Prop} (h : (a ∨ b) = False) : b = False :=
eq_false fun hb ↦ False.elim (Eq.mp: ∀ {α β : Sort ?u.1439}, α = β → α → β
Eq.mp h (Or.inr: ∀ {a b : Prop}, b → a ∨ b
Or.inr hb))
theorem eq_false_of_not_eq_true {a : Prop} (h : Not a = True) : a = False :=
eq_false fun ha ↦ absurd: ∀ {a : Prop} {b : Sort ?u.1470}, a → ¬a → b
absurd ha (Eq.mpr: ∀ {α β : Sort ?u.1473}, α = β → β → α
Eq.mpr h trivial)
/- Remark: the congruence closure module will only use the following lemma is
cc_config.em is tt. -/
theorem eq_true_of_not_eq_false {a : Prop} (h : Not a = False) : a = True :=
eq_true (Classical.byContradiction: ∀ {p : Prop}, (¬p → False) → p
Classical.byContradiction fun hna ↦ Eq.mp: ∀ {α β : Sort ?u.1502}, α = β → α → β
Eq.mp h hna)
theorem ne_of_eq_of_ne: ∀ {α : Sort u} {a b c : α}, a = b → b ≠ c → a ≠ c
ne_of_eq_of_ne {α : Sort u} {a b c : α} (h₁ : a = b) (h₂ : b ≠ c) : a ≠ c :=
h₁.symm: ∀ {α : Sort ?u.1544} {a b : α}, a = b → b = a
symm ▸ h₂
alias ne_of_eq_of_ne: ∀ {α : Sort u} {a b c : α}, a = b → b ≠ c → a ≠ c
ne_of_eq_of_ne ← Eq.trans_ne: ∀ {α : Sort u} {a b c : α}, a = b → b ≠ c → a ≠ c
Eq.trans_ne
#align eq.trans_ne Eq.trans_ne: ∀ {α : Sort u} {a b c : α}, a = b → b ≠ c → a ≠ c
Eq.trans_ne
theorem ne_of_ne_of_eq: ∀ {α : Sort u} {a b c : α}, a ≠ b → b = c → a ≠ c
ne_of_ne_of_eq {α : Sort u} {a b c : α} (h₁ : a ≠ b) (h₂ : b = c) : a ≠ c :=
h₂ ▸ h₁
alias ne_of_ne_of_eq: ∀ {α : Sort u} {a b c : α}, a ≠ b → b = c → a ≠ c
ne_of_ne_of_eq ← Ne.trans_eq: ∀ {α : Sort u} {a b c : α}, a ≠ b → b = c → a ≠ c
Ne.trans_eq
#align ne.trans_eq Ne.trans_eq: ∀ {α : Sort u} {a b c : α}, a ≠ b → b = c → a ≠ c
Ne.trans_eq