fact
stringlengths
6
3.84k
type
stringclasses
11 values
library
stringclasses
32 values
imports
listlengths
1
14
filename
stringlengths
20
95
symbolic_name
stringlengths
1
90
docstring
stringlengths
7
20k
forall_cond_comm {α} {s : α → Prop} {p : α → α → Prop} : (∀ a, s a → ∀ b, s b → p a b) ↔ ∀ a b, s a → s b → p a b := ⟨fun h a b ha hb ↦ h a ha b hb, fun h a ha b hb ↦ h a b ha hb⟩
theorem
Logic
[ "Mathlib.Tactic.Attr.Register", "Mathlib.Tactic.AdaptationNote", "Mathlib.Tactic.Basic", "Batteries.Logic", "Batteries.Tactic.Trans", "Batteries.Util.LibraryNote", "Mathlib.Data.Nat.Notation", "Mathlib.Data.Int.Notation" ]
Mathlib/Logic/Basic.lean
forall_cond_comm
null
forall_mem_comm {α β} [Membership α β] {s : β} {p : α → α → Prop} : (∀ a (_ : a ∈ s) b (_ : b ∈ s), p a b) ↔ ∀ a b, a ∈ s → b ∈ s → p a b := forall_cond_comm
theorem
Logic
[ "Mathlib.Tactic.Attr.Register", "Mathlib.Tactic.AdaptationNote", "Mathlib.Tactic.Basic", "Batteries.Logic", "Batteries.Tactic.Trans", "Batteries.Util.LibraryNote", "Mathlib.Data.Nat.Notation", "Mathlib.Data.Int.Notation" ]
Mathlib/Logic/Basic.lean
forall_mem_comm
null
ne_of_eq_of_ne {α : Sort*} {a b c : α} (h₁ : a = b) (h₂ : b ≠ c) : a ≠ c := h₁.symm ▸ h₂
lemma
Logic
[ "Mathlib.Tactic.Attr.Register", "Mathlib.Tactic.AdaptationNote", "Mathlib.Tactic.Basic", "Batteries.Logic", "Batteries.Tactic.Trans", "Batteries.Util.LibraryNote", "Mathlib.Data.Nat.Notation", "Mathlib.Data.Int.Notation" ]
Mathlib/Logic/Basic.lean
ne_of_eq_of_ne
null
ne_of_ne_of_eq {α : Sort*} {a b c : α} (h₁ : a ≠ b) (h₂ : b = c) : a ≠ c := h₂ ▸ h₁ alias Eq.trans_ne := ne_of_eq_of_ne alias Ne.trans_eq := ne_of_ne_of_eq
lemma
Logic
[ "Mathlib.Tactic.Attr.Register", "Mathlib.Tactic.AdaptationNote", "Mathlib.Tactic.Basic", "Batteries.Logic", "Batteries.Tactic.Trans", "Batteries.Util.LibraryNote", "Mathlib.Data.Nat.Notation", "Mathlib.Data.Int.Notation" ]
Mathlib/Logic/Basic.lean
ne_of_ne_of_eq
null
eq_equivalence {α : Sort*} : Equivalence (@Eq α) := ⟨Eq.refl, @Eq.symm _, @Eq.trans _⟩ attribute [simp] eq_mp_eq_cast eq_mpr_eq_cast
theorem
Logic
[ "Mathlib.Tactic.Attr.Register", "Mathlib.Tactic.AdaptationNote", "Mathlib.Tactic.Basic", "Batteries.Logic", "Batteries.Tactic.Trans", "Batteries.Util.LibraryNote", "Mathlib.Data.Nat.Notation", "Mathlib.Data.Int.Notation" ]
Mathlib/Logic/Basic.lean
eq_equivalence
null
congr_refl_left {α β : Sort*} (f : α → β) {a b : α} (h : a = b) : congr (Eq.refl f) h = congr_arg f h := rfl
theorem
Logic
[ "Mathlib.Tactic.Attr.Register", "Mathlib.Tactic.AdaptationNote", "Mathlib.Tactic.Basic", "Batteries.Logic", "Batteries.Tactic.Trans", "Batteries.Util.LibraryNote", "Mathlib.Data.Nat.Notation", "Mathlib.Data.Int.Notation" ]
Mathlib/Logic/Basic.lean
congr_refl_left
null
congr_refl_right {α β : Sort*} {f g : α → β} (h : f = g) (a : α) : congr h (Eq.refl a) = congr_fun h a := rfl
theorem
Logic
[ "Mathlib.Tactic.Attr.Register", "Mathlib.Tactic.AdaptationNote", "Mathlib.Tactic.Basic", "Batteries.Logic", "Batteries.Tactic.Trans", "Batteries.Util.LibraryNote", "Mathlib.Data.Nat.Notation", "Mathlib.Data.Int.Notation" ]
Mathlib/Logic/Basic.lean
congr_refl_right
null
congr_arg_refl {α β : Sort*} (f : α → β) (a : α) : congr_arg f (Eq.refl a) = Eq.refl (f a) := rfl
theorem
Logic
[ "Mathlib.Tactic.Attr.Register", "Mathlib.Tactic.AdaptationNote", "Mathlib.Tactic.Basic", "Batteries.Logic", "Batteries.Tactic.Trans", "Batteries.Util.LibraryNote", "Mathlib.Data.Nat.Notation", "Mathlib.Data.Int.Notation" ]
Mathlib/Logic/Basic.lean
congr_arg_refl
null
congr_fun_rfl {α β : Sort*} (f : α → β) (a : α) : congr_fun (Eq.refl f) a = Eq.refl (f a) := rfl
theorem
Logic
[ "Mathlib.Tactic.Attr.Register", "Mathlib.Tactic.AdaptationNote", "Mathlib.Tactic.Basic", "Batteries.Logic", "Batteries.Tactic.Trans", "Batteries.Util.LibraryNote", "Mathlib.Data.Nat.Notation", "Mathlib.Data.Int.Notation" ]
Mathlib/Logic/Basic.lean
congr_fun_rfl
null
congr_fun_congr_arg {α β γ : Sort*} (f : α → β → γ) {a a' : α} (p : a = a') (b : β) : congr_fun (congr_arg f p) b = congr_arg (fun a ↦ f a b) p := rfl @[deprecated (since := "2025-09-16")] alias Eq.rec_eq_cast := eqRec_eq_cast @[deprecated (since := "2025-09-16")] alias eqRec_heq' := eqRec_heq_self
theorem
Logic
[ "Mathlib.Tactic.Attr.Register", "Mathlib.Tactic.AdaptationNote", "Mathlib.Tactic.Basic", "Batteries.Logic", "Batteries.Tactic.Trans", "Batteries.Util.LibraryNote", "Mathlib.Data.Nat.Notation", "Mathlib.Data.Int.Notation" ]
Mathlib/Logic/Basic.lean
congr_fun_congr_arg
null
rec_heq_of_heq {α β : Sort _} {a b : α} {C : α → Sort*} {x : C a} {y : β} (e : a = b) (h : x ≍ y) : e ▸ x ≍ y := eqRec_heq_iff_heq.mpr h @[deprecated (since := "2025-09-16")] alias rec_heq_iff_heq := eqRec_heq_iff_heq @[deprecated (since := "2025-09-16")] alias heq_rec_iff_heq := heq_eqRec_iff_heq @[simp]
theorem
Logic
[ "Mathlib.Tactic.Attr.Register", "Mathlib.Tactic.AdaptationNote", "Mathlib.Tactic.Basic", "Batteries.Logic", "Batteries.Tactic.Trans", "Batteries.Util.LibraryNote", "Mathlib.Data.Nat.Notation", "Mathlib.Data.Int.Notation" ]
Mathlib/Logic/Basic.lean
rec_heq_of_heq
null
cast_heq_iff_heq {α β γ : Sort _} (e : α = β) (a : α) (c : γ) : cast e a ≍ c ↔ a ≍ c := by subst e; rfl @[simp]
theorem
Logic
[ "Mathlib.Tactic.Attr.Register", "Mathlib.Tactic.AdaptationNote", "Mathlib.Tactic.Basic", "Batteries.Logic", "Batteries.Tactic.Trans", "Batteries.Util.LibraryNote", "Mathlib.Data.Nat.Notation", "Mathlib.Data.Int.Notation" ]
Mathlib/Logic/Basic.lean
cast_heq_iff_heq
null
heq_cast_iff_heq {α β γ : Sort _} (e : β = γ) (a : α) (b : β) : a ≍ cast e b ↔ a ≍ b := by subst e; rfl universe u variable {α β : Sort u} {e : β = α} {a : α} {b : β}
theorem
Logic
[ "Mathlib.Tactic.Attr.Register", "Mathlib.Tactic.AdaptationNote", "Mathlib.Tactic.Basic", "Batteries.Logic", "Batteries.Tactic.Trans", "Batteries.Util.LibraryNote", "Mathlib.Data.Nat.Notation", "Mathlib.Data.Int.Notation" ]
Mathlib/Logic/Basic.lean
heq_cast_iff_heq
null
heq_of_eq_cast (e : β = α) : a = cast e b → a ≍ b := by rintro rfl; simp
lemma
Logic
[ "Mathlib.Tactic.Attr.Register", "Mathlib.Tactic.AdaptationNote", "Mathlib.Tactic.Basic", "Batteries.Logic", "Batteries.Tactic.Trans", "Batteries.Util.LibraryNote", "Mathlib.Data.Nat.Notation", "Mathlib.Data.Int.Notation" ]
Mathlib/Logic/Basic.lean
heq_of_eq_cast
null
eq_cast_iff_heq : a = cast e b ↔ a ≍ b := ⟨heq_of_eq_cast _, fun h ↦ by cases h; rfl⟩
lemma
Logic
[ "Mathlib.Tactic.Attr.Register", "Mathlib.Tactic.AdaptationNote", "Mathlib.Tactic.Basic", "Batteries.Logic", "Batteries.Tactic.Trans", "Batteries.Util.LibraryNote", "Mathlib.Data.Nat.Notation", "Mathlib.Data.Int.Notation" ]
Mathlib/Logic/Basic.lean
eq_cast_iff_heq
null
heq_iff_exists_eq_cast : a ≍ b ↔ ∃ (h : β = α), a = cast h b := ⟨fun h ↦ ⟨type_eq_of_heq h.symm, eq_cast_iff_heq.mpr h⟩, by rintro ⟨rfl, h⟩; rw [h, cast_eq]⟩
lemma
Logic
[ "Mathlib.Tactic.Attr.Register", "Mathlib.Tactic.AdaptationNote", "Mathlib.Tactic.Basic", "Batteries.Logic", "Batteries.Tactic.Trans", "Batteries.Util.LibraryNote", "Mathlib.Data.Nat.Notation", "Mathlib.Data.Int.Notation" ]
Mathlib/Logic/Basic.lean
heq_iff_exists_eq_cast
null
heq_iff_exists_cast_eq : a ≍ b ↔ ∃ (h : α = β), cast h a = b := by simp only [heq_comm (a := a), heq_iff_exists_eq_cast, eq_comm]
lemma
Logic
[ "Mathlib.Tactic.Attr.Register", "Mathlib.Tactic.AdaptationNote", "Mathlib.Tactic.Basic", "Batteries.Logic", "Batteries.Tactic.Trans", "Batteries.Util.LibraryNote", "Mathlib.Data.Nat.Notation", "Mathlib.Data.Int.Notation" ]
Mathlib/Logic/Basic.lean
heq_iff_exists_cast_eq
null
forall₂_imp {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_imp fun i ↦ forall_imp <| h i
theorem
Logic
[ "Mathlib.Tactic.Attr.Register", "Mathlib.Tactic.AdaptationNote", "Mathlib.Tactic.Basic", "Batteries.Logic", "Batteries.Tactic.Trans", "Batteries.Util.LibraryNote", "Mathlib.Data.Nat.Notation", "Mathlib.Data.Int.Notation" ]
Mathlib/Logic/Basic.lean
forall₂_imp
null
forall₃_imp {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_imp fun a ↦ forall₂_imp <| h a
theorem
Logic
[ "Mathlib.Tactic.Attr.Register", "Mathlib.Tactic.AdaptationNote", "Mathlib.Tactic.Basic", "Batteries.Logic", "Batteries.Tactic.Trans", "Batteries.Util.LibraryNote", "Mathlib.Data.Nat.Notation", "Mathlib.Data.Int.Notation" ]
Mathlib/Logic/Basic.lean
forall₃_imp
null
Exists₂.imp {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.imp fun a ↦ Exists.imp <| h a
theorem
Logic
[ "Mathlib.Tactic.Attr.Register", "Mathlib.Tactic.AdaptationNote", "Mathlib.Tactic.Basic", "Batteries.Logic", "Batteries.Tactic.Trans", "Batteries.Util.LibraryNote", "Mathlib.Data.Nat.Notation", "Mathlib.Data.Int.Notation" ]
Mathlib/Logic/Basic.lean
Exists₂.imp
null
Exists₃.imp {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.imp fun a ↦ Exists₂.imp <| h a
theorem
Logic
[ "Mathlib.Tactic.Attr.Register", "Mathlib.Tactic.AdaptationNote", "Mathlib.Tactic.Basic", "Batteries.Logic", "Batteries.Tactic.Trans", "Batteries.Util.LibraryNote", "Mathlib.Data.Nat.Notation", "Mathlib.Data.Int.Notation" ]
Mathlib/Logic/Basic.lean
Exists₃.imp
null
forall_swap {p : α → β → Prop} : (∀ x y, p x y) ↔ ∀ y x, p x y := ⟨fun f x y ↦ f y x, fun f x y ↦ f y x⟩
theorem
Logic
[ "Mathlib.Tactic.Attr.Register", "Mathlib.Tactic.AdaptationNote", "Mathlib.Tactic.Basic", "Batteries.Logic", "Batteries.Tactic.Trans", "Batteries.Util.LibraryNote", "Mathlib.Data.Nat.Notation", "Mathlib.Data.Int.Notation" ]
Mathlib/Logic/Basic.lean
forall_swap
null
forall₂_swap {ι₁ ι₂ : Sort*} {κ₁ : ι₁ → Sort*} {κ₂ : ι₂ → Sort*} {p : ∀ i₁, κ₁ i₁ → ∀ i₂, κ₂ i₂ → Prop} : (∀ i₁ j₁ i₂ j₂, p i₁ j₁ i₂ j₂) ↔ ∀ i₂ j₂ i₁ j₁, p i₁ j₁ i₂ j₂ := ⟨swap₂, swap₂⟩
theorem
Logic
[ "Mathlib.Tactic.Attr.Register", "Mathlib.Tactic.AdaptationNote", "Mathlib.Tactic.Basic", "Batteries.Logic", "Batteries.Tactic.Trans", "Batteries.Util.LibraryNote", "Mathlib.Data.Nat.Notation", "Mathlib.Data.Int.Notation" ]
Mathlib/Logic/Basic.lean
forall₂_swap
null
imp_forall_iff {α : Type*} {p : Prop} {q : α → Prop} : (p → ∀ x, q x) ↔ ∀ x, p → q x := forall_swap
theorem
Logic
[ "Mathlib.Tactic.Attr.Register", "Mathlib.Tactic.AdaptationNote", "Mathlib.Tactic.Basic", "Batteries.Logic", "Batteries.Tactic.Trans", "Batteries.Util.LibraryNote", "Mathlib.Data.Nat.Notation", "Mathlib.Data.Int.Notation" ]
Mathlib/Logic/Basic.lean
imp_forall_iff
We intentionally restrict the type of `α` in this lemma so that this is a safer to use in simp than `forall_swap`.
imp_forall_iff_forall (A : Prop) (B : A → Prop) : (A → ∀ h : A, B h) ↔ ∀ h : A, B h := by by_cases h : A <;> simp [h]
lemma
Logic
[ "Mathlib.Tactic.Attr.Register", "Mathlib.Tactic.AdaptationNote", "Mathlib.Tactic.Basic", "Batteries.Logic", "Batteries.Tactic.Trans", "Batteries.Util.LibraryNote", "Mathlib.Data.Nat.Notation", "Mathlib.Data.Int.Notation" ]
Mathlib/Logic/Basic.lean
imp_forall_iff_forall
null
exists_swap {p : α → β → Prop} : (∃ x y, p x y) ↔ ∃ y x, p x y := ⟨fun ⟨x, y, h⟩ ↦ ⟨y, x, h⟩, fun ⟨y, x, h⟩ ↦ ⟨x, y, h⟩⟩
theorem
Logic
[ "Mathlib.Tactic.Attr.Register", "Mathlib.Tactic.AdaptationNote", "Mathlib.Tactic.Basic", "Batteries.Logic", "Batteries.Tactic.Trans", "Batteries.Util.LibraryNote", "Mathlib.Data.Nat.Notation", "Mathlib.Data.Int.Notation" ]
Mathlib/Logic/Basic.lean
exists_swap
null
exists_and_exists_comm {P : α → Prop} {Q : β → Prop} : (∃ a, P a) ∧ (∃ b, Q b) ↔ ∃ a b, P a ∧ Q b := ⟨fun ⟨⟨a, ha⟩, ⟨b, hb⟩⟩ ↦ ⟨a, b, ⟨ha, hb⟩⟩, fun ⟨a, b, ⟨ha, hb⟩⟩ ↦ ⟨⟨a, ha⟩, ⟨b, hb⟩⟩⟩ export Classical (not_forall)
theorem
Logic
[ "Mathlib.Tactic.Attr.Register", "Mathlib.Tactic.AdaptationNote", "Mathlib.Tactic.Basic", "Batteries.Logic", "Batteries.Tactic.Trans", "Batteries.Util.LibraryNote", "Mathlib.Data.Nat.Notation", "Mathlib.Data.Int.Notation" ]
Mathlib/Logic/Basic.lean
exists_and_exists_comm
null
not_forall_not : (¬∀ x, ¬p x) ↔ ∃ x, p x := open scoped Classical in Decidable.not_forall_not export Classical (not_exists_not)
theorem
Logic
[ "Mathlib.Tactic.Attr.Register", "Mathlib.Tactic.AdaptationNote", "Mathlib.Tactic.Basic", "Batteries.Logic", "Batteries.Tactic.Trans", "Batteries.Util.LibraryNote", "Mathlib.Data.Nat.Notation", "Mathlib.Data.Int.Notation" ]
Mathlib/Logic/Basic.lean
not_forall_not
null
forall_or_exists_not (P : α → Prop) : (∀ a, P a) ∨ ∃ a, ¬P a := by rw [← not_forall]; exact em _
lemma
Logic
[ "Mathlib.Tactic.Attr.Register", "Mathlib.Tactic.AdaptationNote", "Mathlib.Tactic.Basic", "Batteries.Logic", "Batteries.Tactic.Trans", "Batteries.Util.LibraryNote", "Mathlib.Data.Nat.Notation", "Mathlib.Data.Int.Notation" ]
Mathlib/Logic/Basic.lean
forall_or_exists_not
null
exists_or_forall_not (P : α → Prop) : (∃ a, P a) ∨ ∀ a, ¬P a := by rw [← not_exists]; exact em _
lemma
Logic
[ "Mathlib.Tactic.Attr.Register", "Mathlib.Tactic.AdaptationNote", "Mathlib.Tactic.Basic", "Batteries.Logic", "Batteries.Tactic.Trans", "Batteries.Util.LibraryNote", "Mathlib.Data.Nat.Notation", "Mathlib.Data.Int.Notation" ]
Mathlib/Logic/Basic.lean
exists_or_forall_not
null
forall_imp_iff_exists_imp {α : Sort*} {p : α → Prop} {b : Prop} [ha : Nonempty α] : (∀ x, p x) → b ↔ ∃ x, p x → b := by classical let ⟨a⟩ := ha refine ⟨fun h ↦ not_forall_not.1 fun h' ↦ ?_, fun ⟨x, hx⟩ h ↦ hx (h x)⟩ exact if hb : b then h' a fun _ ↦ hb else hb <| h fun x ↦ (_root_.not_imp.1 (h' x)).1 @[mfld_simps]
theorem
Logic
[ "Mathlib.Tactic.Attr.Register", "Mathlib.Tactic.AdaptationNote", "Mathlib.Tactic.Basic", "Batteries.Logic", "Batteries.Tactic.Trans", "Batteries.Util.LibraryNote", "Mathlib.Data.Nat.Notation", "Mathlib.Data.Int.Notation" ]
Mathlib/Logic/Basic.lean
forall_imp_iff_exists_imp
null
forall_true_iff : (α → True) ↔ True := imp_true_iff _
theorem
Logic
[ "Mathlib.Tactic.Attr.Register", "Mathlib.Tactic.AdaptationNote", "Mathlib.Tactic.Basic", "Batteries.Logic", "Batteries.Tactic.Trans", "Batteries.Util.LibraryNote", "Mathlib.Data.Nat.Notation", "Mathlib.Data.Int.Notation" ]
Mathlib/Logic/Basic.lean
forall_true_iff
null
forall_true_iff' (h : ∀ a, p a ↔ True) : (∀ a, p a) ↔ True := iff_true_intro fun _ ↦ of_iff_true (h _)
theorem
Logic
[ "Mathlib.Tactic.Attr.Register", "Mathlib.Tactic.AdaptationNote", "Mathlib.Tactic.Basic", "Batteries.Logic", "Batteries.Tactic.Trans", "Batteries.Util.LibraryNote", "Mathlib.Data.Nat.Notation", "Mathlib.Data.Int.Notation" ]
Mathlib/Logic/Basic.lean
forall_true_iff'
null
forall₂_true_iff {β : α → Sort*} : (∀ a, β a → True) ↔ True := by simp
theorem
Logic
[ "Mathlib.Tactic.Attr.Register", "Mathlib.Tactic.AdaptationNote", "Mathlib.Tactic.Basic", "Batteries.Logic", "Batteries.Tactic.Trans", "Batteries.Util.LibraryNote", "Mathlib.Data.Nat.Notation", "Mathlib.Data.Int.Notation" ]
Mathlib/Logic/Basic.lean
forall₂_true_iff
null
forall₃_true_iff {β : α → Sort*} {γ : ∀ a, β a → Sort*} : (∀ (a) (b : β a), γ a b → True) ↔ True := by simp
theorem
Logic
[ "Mathlib.Tactic.Attr.Register", "Mathlib.Tactic.AdaptationNote", "Mathlib.Tactic.Basic", "Batteries.Logic", "Batteries.Tactic.Trans", "Batteries.Util.LibraryNote", "Mathlib.Data.Nat.Notation", "Mathlib.Data.Int.Notation" ]
Mathlib/Logic/Basic.lean
forall₃_true_iff
null
Decidable.and_forall_ne [DecidableEq α] (a : α) {p : α → Prop} : (p a ∧ ∀ b, b ≠ a → p b) ↔ ∀ b, p b := by simp only [← @forall_eq _ p a, ← forall_and, ← or_imp, Decidable.em, forall_const]
theorem
Logic
[ "Mathlib.Tactic.Attr.Register", "Mathlib.Tactic.AdaptationNote", "Mathlib.Tactic.Basic", "Batteries.Logic", "Batteries.Tactic.Trans", "Batteries.Util.LibraryNote", "Mathlib.Data.Nat.Notation", "Mathlib.Data.Int.Notation" ]
Mathlib/Logic/Basic.lean
Decidable.and_forall_ne
null
and_forall_ne (a : α) : (p a ∧ ∀ b, b ≠ a → p b) ↔ ∀ b, p b := open scoped Classical in Decidable.and_forall_ne a
theorem
Logic
[ "Mathlib.Tactic.Attr.Register", "Mathlib.Tactic.AdaptationNote", "Mathlib.Tactic.Basic", "Batteries.Logic", "Batteries.Tactic.Trans", "Batteries.Util.LibraryNote", "Mathlib.Data.Nat.Notation", "Mathlib.Data.Int.Notation" ]
Mathlib/Logic/Basic.lean
and_forall_ne
null
Ne.ne_or_ne {x y : α} (z : α) (h : x ≠ y) : x ≠ z ∨ y ≠ z := not_and_or.1 <| mt (and_imp.2 (· ▸ ·)) h.symm @[simp]
theorem
Logic
[ "Mathlib.Tactic.Attr.Register", "Mathlib.Tactic.AdaptationNote", "Mathlib.Tactic.Basic", "Batteries.Logic", "Batteries.Tactic.Trans", "Batteries.Util.LibraryNote", "Mathlib.Data.Nat.Notation", "Mathlib.Data.Int.Notation" ]
Mathlib/Logic/Basic.lean
Ne.ne_or_ne
null
exists_apply_eq_apply' (f : α → β) (a' : α) : ∃ a, f a' = f a := ⟨a', rfl⟩ @[simp]
theorem
Logic
[ "Mathlib.Tactic.Attr.Register", "Mathlib.Tactic.AdaptationNote", "Mathlib.Tactic.Basic", "Batteries.Logic", "Batteries.Tactic.Trans", "Batteries.Util.LibraryNote", "Mathlib.Data.Nat.Notation", "Mathlib.Data.Int.Notation" ]
Mathlib/Logic/Basic.lean
exists_apply_eq_apply'
null
exists_apply_eq_apply2 {α β γ} {f : α → β → γ} {a : α} {b : β} : ∃ x y, f x y = f a b := ⟨a, b, rfl⟩ @[simp]
lemma
Logic
[ "Mathlib.Tactic.Attr.Register", "Mathlib.Tactic.AdaptationNote", "Mathlib.Tactic.Basic", "Batteries.Logic", "Batteries.Tactic.Trans", "Batteries.Util.LibraryNote", "Mathlib.Data.Nat.Notation", "Mathlib.Data.Int.Notation" ]
Mathlib/Logic/Basic.lean
exists_apply_eq_apply2
null
exists_apply_eq_apply2' {α β γ} {f : α → β → γ} {a : α} {b : β} : ∃ x y, f a b = f x y := ⟨a, b, rfl⟩ @[simp]
lemma
Logic
[ "Mathlib.Tactic.Attr.Register", "Mathlib.Tactic.AdaptationNote", "Mathlib.Tactic.Basic", "Batteries.Logic", "Batteries.Tactic.Trans", "Batteries.Util.LibraryNote", "Mathlib.Data.Nat.Notation", "Mathlib.Data.Int.Notation" ]
Mathlib/Logic/Basic.lean
exists_apply_eq_apply2'
null
exists_apply_eq_apply3 {α β γ δ} {f : α → β → γ → δ} {a : α} {b : β} {c : γ} : ∃ x y z, f x y z = f a b c := ⟨a, b, c, rfl⟩ @[simp]
lemma
Logic
[ "Mathlib.Tactic.Attr.Register", "Mathlib.Tactic.AdaptationNote", "Mathlib.Tactic.Basic", "Batteries.Logic", "Batteries.Tactic.Trans", "Batteries.Util.LibraryNote", "Mathlib.Data.Nat.Notation", "Mathlib.Data.Int.Notation" ]
Mathlib/Logic/Basic.lean
exists_apply_eq_apply3
null
exists_apply_eq_apply3' {α β γ δ} {f : α → β → γ → δ} {a : α} {b : β} {c : γ} : ∃ x y z, f a b c = f x y z := ⟨a, b, c, rfl⟩
lemma
Logic
[ "Mathlib.Tactic.Attr.Register", "Mathlib.Tactic.AdaptationNote", "Mathlib.Tactic.Basic", "Batteries.Logic", "Batteries.Tactic.Trans", "Batteries.Util.LibraryNote", "Mathlib.Data.Nat.Notation", "Mathlib.Data.Int.Notation" ]
Mathlib/Logic/Basic.lean
exists_apply_eq_apply3'
null
exists_apply_eq (a : α) (b : β) : ∃ f : α → β, f a = b := ⟨fun _ ↦ b, rfl⟩ @[simp] theorem exists_exists_and_eq_and {f : α → β} {p : α → Prop} {q : β → Prop} : (∃ b, (∃ a, p a ∧ f a = b) ∧ q b) ↔ ∃ a, p a ∧ q (f a) := ⟨fun ⟨_, ⟨a, ha, hab⟩, hb⟩ ↦ ⟨a, ha, hab.symm ▸ hb⟩, fun ⟨a, hp, hq⟩ ↦ ⟨f a, ⟨a, hp, rfl⟩, hq⟩⟩ @[simp] theorem exists_exists_eq_and {f : α → β} {p : β → Prop} : (∃ b, (∃ a, f a = b) ∧ p b) ↔ ∃ a, p (f a) := ⟨fun ⟨_, ⟨a, ha⟩, hb⟩ ↦ ⟨a, ha.symm ▸ hb⟩, fun ⟨a, ha⟩ ↦ ⟨f a, ⟨a, rfl⟩, ha⟩⟩ @[simp] theorem exists_exists_and_exists_and_eq_and {α β γ : Type*} {f : α → β → γ} {p : α → Prop} {q : β → Prop} {r : γ → Prop} : (∃ c, (∃ a, p a ∧ ∃ b, q b ∧ f a b = c) ∧ r c) ↔ ∃ a, p a ∧ ∃ b, q b ∧ r (f a b) := ⟨fun ⟨_, ⟨a, ha, b, hb, hab⟩, hc⟩ ↦ ⟨a, ha, b, hb, hab.symm ▸ hc⟩, fun ⟨a, ha, b, hb, hab⟩ ↦ ⟨f a b, ⟨a, ha, b, hb, rfl⟩, hab⟩⟩ @[simp] theorem exists_exists_exists_and_eq {α β γ : Type*} {f : α → β → γ} {p : γ → Prop} : (∃ c, (∃ a, ∃ b, f a b = c) ∧ p c) ↔ ∃ a, ∃ b, p (f a b) := ⟨fun ⟨_, ⟨a, b, hab⟩, hc⟩ ↦ ⟨a, b, hab.symm ▸ hc⟩, fun ⟨a, b, hab⟩ ↦ ⟨f a b, ⟨a, b, rfl⟩, hab⟩⟩
theorem
Logic
[ "Mathlib.Tactic.Attr.Register", "Mathlib.Tactic.AdaptationNote", "Mathlib.Tactic.Basic", "Batteries.Logic", "Batteries.Tactic.Trans", "Batteries.Util.LibraryNote", "Mathlib.Data.Nat.Notation", "Mathlib.Data.Int.Notation" ]
Mathlib/Logic/Basic.lean
exists_apply_eq
The constant function witnesses that there exists a function sending a given term to a given term. This is sometimes useful in `simp` to discharge side conditions.
forall_apply_eq_imp_iff' {f : α → β} {p : β → Prop} : (∀ a b, f a = b → p b) ↔ ∀ a, p (f a) := by simp
theorem
Logic
[ "Mathlib.Tactic.Attr.Register", "Mathlib.Tactic.AdaptationNote", "Mathlib.Tactic.Basic", "Batteries.Logic", "Batteries.Tactic.Trans", "Batteries.Util.LibraryNote", "Mathlib.Data.Nat.Notation", "Mathlib.Data.Int.Notation" ]
Mathlib/Logic/Basic.lean
forall_apply_eq_imp_iff'
null
forall_eq_apply_imp_iff' {f : α → β} {p : β → Prop} : (∀ a b, b = f a → p b) ↔ ∀ a, p (f a) := by simp
theorem
Logic
[ "Mathlib.Tactic.Attr.Register", "Mathlib.Tactic.AdaptationNote", "Mathlib.Tactic.Basic", "Batteries.Logic", "Batteries.Tactic.Trans", "Batteries.Util.LibraryNote", "Mathlib.Data.Nat.Notation", "Mathlib.Data.Int.Notation" ]
Mathlib/Logic/Basic.lean
forall_eq_apply_imp_iff'
null
exists₂_comm {ι₁ ι₂ : Sort*} {κ₁ : ι₁ → Sort*} {κ₂ : ι₂ → Sort*} {p : ∀ i₁, κ₁ i₁ → ∀ i₂, κ₂ i₂ → Prop} : (∃ i₁ j₁ i₂ j₂, p i₁ j₁ i₂ j₂) ↔ ∃ i₂ j₂ i₁ j₁, p i₁ j₁ i₂ j₂ := by simp only [@exists_comm (κ₁ _), @exists_comm ι₁]
theorem
Logic
[ "Mathlib.Tactic.Attr.Register", "Mathlib.Tactic.AdaptationNote", "Mathlib.Tactic.Basic", "Batteries.Logic", "Batteries.Tactic.Trans", "Batteries.Util.LibraryNote", "Mathlib.Data.Nat.Notation", "Mathlib.Data.Int.Notation" ]
Mathlib/Logic/Basic.lean
exists₂_comm
null
And.exists {p q : Prop} {f : p ∧ q → Prop} : (∃ h, f h) ↔ ∃ hp hq, f ⟨hp, hq⟩ := ⟨fun ⟨h, H⟩ ↦ ⟨h.1, h.2, H⟩, fun ⟨hp, hq, H⟩ ↦ ⟨⟨hp, hq⟩, H⟩⟩
theorem
Logic
[ "Mathlib.Tactic.Attr.Register", "Mathlib.Tactic.AdaptationNote", "Mathlib.Tactic.Basic", "Batteries.Logic", "Batteries.Tactic.Trans", "Batteries.Util.LibraryNote", "Mathlib.Data.Nat.Notation", "Mathlib.Data.Int.Notation" ]
Mathlib/Logic/Basic.lean
And.exists
null
forall_or_of_or_forall {α : Sort*} {p : α → Prop} {b : Prop} (h : b ∨ ∀ x, p x) (x : α) : b ∨ p x := h.imp_right fun h₂ ↦ h₂ x
theorem
Logic
[ "Mathlib.Tactic.Attr.Register", "Mathlib.Tactic.AdaptationNote", "Mathlib.Tactic.Basic", "Batteries.Logic", "Batteries.Tactic.Trans", "Batteries.Util.LibraryNote", "Mathlib.Data.Nat.Notation", "Mathlib.Data.Int.Notation" ]
Mathlib/Logic/Basic.lean
forall_or_of_or_forall
null
protected Decidable.forall_or_left {q : Prop} {p : α → Prop} [Decidable q] : (∀ x, q ∨ p x) ↔ q ∨ ∀ x, p x := ⟨fun h ↦ if hq : q then Or.inl hq else Or.inr fun x ↦ (h x).resolve_left hq, forall_or_of_or_forall⟩
theorem
Logic
[ "Mathlib.Tactic.Attr.Register", "Mathlib.Tactic.AdaptationNote", "Mathlib.Tactic.Basic", "Batteries.Logic", "Batteries.Tactic.Trans", "Batteries.Util.LibraryNote", "Mathlib.Data.Nat.Notation", "Mathlib.Data.Int.Notation" ]
Mathlib/Logic/Basic.lean
Decidable.forall_or_left
null
forall_or_left {q} {p : α → Prop} : (∀ x, q ∨ p x) ↔ q ∨ ∀ x, p x := open scoped Classical in Decidable.forall_or_left
theorem
Logic
[ "Mathlib.Tactic.Attr.Register", "Mathlib.Tactic.AdaptationNote", "Mathlib.Tactic.Basic", "Batteries.Logic", "Batteries.Tactic.Trans", "Batteries.Util.LibraryNote", "Mathlib.Data.Nat.Notation", "Mathlib.Data.Int.Notation" ]
Mathlib/Logic/Basic.lean
forall_or_left
null
protected Decidable.forall_or_right {q} {p : α → Prop} [Decidable q] : (∀ x, p x ∨ q) ↔ (∀ x, p x) ∨ q := by simp [or_comm, Decidable.forall_or_left]
theorem
Logic
[ "Mathlib.Tactic.Attr.Register", "Mathlib.Tactic.AdaptationNote", "Mathlib.Tactic.Basic", "Batteries.Logic", "Batteries.Tactic.Trans", "Batteries.Util.LibraryNote", "Mathlib.Data.Nat.Notation", "Mathlib.Data.Int.Notation" ]
Mathlib/Logic/Basic.lean
Decidable.forall_or_right
null
forall_or_right {q} {p : α → Prop} : (∀ x, p x ∨ q) ↔ (∀ x, p x) ∨ q := open scoped Classical in Decidable.forall_or_right @[simp]
theorem
Logic
[ "Mathlib.Tactic.Attr.Register", "Mathlib.Tactic.AdaptationNote", "Mathlib.Tactic.Basic", "Batteries.Logic", "Batteries.Tactic.Trans", "Batteries.Util.LibraryNote", "Mathlib.Data.Nat.Notation", "Mathlib.Data.Int.Notation" ]
Mathlib/Logic/Basic.lean
forall_or_right
null
forall_and_index {p q : Prop} {r : p ∧ q → Prop} : (∀ h : p ∧ q, r h) ↔ ∀ (hp : p) (hq : q), r ⟨hp, hq⟩ := ⟨fun h hp hq ↦ h ⟨hp, hq⟩, fun h h1 ↦ h h1.1 h1.2⟩
theorem
Logic
[ "Mathlib.Tactic.Attr.Register", "Mathlib.Tactic.AdaptationNote", "Mathlib.Tactic.Basic", "Batteries.Logic", "Batteries.Tactic.Trans", "Batteries.Util.LibraryNote", "Mathlib.Data.Nat.Notation", "Mathlib.Data.Int.Notation" ]
Mathlib/Logic/Basic.lean
forall_and_index
null
forall_and_index' {p q : Prop} {r : p → q → Prop} : (∀ (hp : p) (hq : q), r hp hq) ↔ ∀ h : p ∧ q, r h.1 h.2 := (forall_and_index (r := fun h => r h.1 h.2)).symm
theorem
Logic
[ "Mathlib.Tactic.Attr.Register", "Mathlib.Tactic.AdaptationNote", "Mathlib.Tactic.Basic", "Batteries.Logic", "Batteries.Tactic.Trans", "Batteries.Util.LibraryNote", "Mathlib.Data.Nat.Notation", "Mathlib.Data.Int.Notation" ]
Mathlib/Logic/Basic.lean
forall_and_index'
null
Exists.fst {b : Prop} {p : b → Prop} : Exists p → b | ⟨h, _⟩ => h
theorem
Logic
[ "Mathlib.Tactic.Attr.Register", "Mathlib.Tactic.AdaptationNote", "Mathlib.Tactic.Basic", "Batteries.Logic", "Batteries.Tactic.Trans", "Batteries.Util.LibraryNote", "Mathlib.Data.Nat.Notation", "Mathlib.Data.Int.Notation" ]
Mathlib/Logic/Basic.lean
Exists.fst
null
Exists.snd {b : Prop} {p : b → Prop} : ∀ h : Exists p, p h.fst | ⟨_, h⟩ => h
theorem
Logic
[ "Mathlib.Tactic.Attr.Register", "Mathlib.Tactic.AdaptationNote", "Mathlib.Tactic.Basic", "Batteries.Logic", "Batteries.Tactic.Trans", "Batteries.Util.LibraryNote", "Mathlib.Data.Nat.Notation", "Mathlib.Data.Int.Notation" ]
Mathlib/Logic/Basic.lean
Exists.snd
null
Prop.exists_iff {p : Prop → Prop} : (∃ h, p h) ↔ p False ∨ p True := ⟨fun ⟨h₁, h₂⟩ ↦ by_cases (fun H : h₁ ↦ .inr <| by simpa only [H] using h₂) (fun H ↦ .inl <| by simpa only [H] using h₂), fun h ↦ h.elim (.intro _) (.intro _)⟩
theorem
Logic
[ "Mathlib.Tactic.Attr.Register", "Mathlib.Tactic.AdaptationNote", "Mathlib.Tactic.Basic", "Batteries.Logic", "Batteries.Tactic.Trans", "Batteries.Util.LibraryNote", "Mathlib.Data.Nat.Notation", "Mathlib.Data.Int.Notation" ]
Mathlib/Logic/Basic.lean
Prop.exists_iff
null
Prop.forall_iff {p : Prop → Prop} : (∀ h, p h) ↔ p False ∧ p True := ⟨fun H ↦ ⟨H _, H _⟩, fun ⟨h₁, h₂⟩ h ↦ by by_cases H : h <;> simpa only [H]⟩
theorem
Logic
[ "Mathlib.Tactic.Attr.Register", "Mathlib.Tactic.AdaptationNote", "Mathlib.Tactic.Basic", "Batteries.Logic", "Batteries.Tactic.Trans", "Batteries.Util.LibraryNote", "Mathlib.Data.Nat.Notation", "Mathlib.Data.Int.Notation" ]
Mathlib/Logic/Basic.lean
Prop.forall_iff
null
exists_iff_of_forall {p : Prop} {q : p → Prop} (h : ∀ h, q h) : (∃ h, q h) ↔ p := ⟨Exists.fst, fun H ↦ ⟨H, h H⟩⟩
theorem
Logic
[ "Mathlib.Tactic.Attr.Register", "Mathlib.Tactic.AdaptationNote", "Mathlib.Tactic.Basic", "Batteries.Logic", "Batteries.Tactic.Trans", "Batteries.Util.LibraryNote", "Mathlib.Data.Nat.Notation", "Mathlib.Data.Int.Notation" ]
Mathlib/Logic/Basic.lean
exists_iff_of_forall
null
exists_prop_of_false {p : Prop} {q : p → Prop} : ¬p → ¬∃ h' : p, q h' := mt Exists.fst /- See `IsEmpty.exists_iff` for the `False` version of `exists_true_left`. -/
theorem
Logic
[ "Mathlib.Tactic.Attr.Register", "Mathlib.Tactic.AdaptationNote", "Mathlib.Tactic.Basic", "Batteries.Logic", "Batteries.Tactic.Trans", "Batteries.Util.LibraryNote", "Mathlib.Data.Nat.Notation", "Mathlib.Data.Int.Notation" ]
Mathlib/Logic/Basic.lean
exists_prop_of_false
null
forall_prop_congr {p p' : Prop} {q q' : p → Prop} (hq : ∀ h, q h ↔ q' h) (hp : p ↔ p') : (∀ h, q h) ↔ ∀ h : p', q' (hp.2 h) := ⟨fun h1 h2 ↦ (hq _).1 (h1 (hp.2 h2)), fun h1 h2 ↦ (hq _).2 (h1 (hp.1 h2))⟩
theorem
Logic
[ "Mathlib.Tactic.Attr.Register", "Mathlib.Tactic.AdaptationNote", "Mathlib.Tactic.Basic", "Batteries.Logic", "Batteries.Tactic.Trans", "Batteries.Util.LibraryNote", "Mathlib.Data.Nat.Notation", "Mathlib.Data.Int.Notation" ]
Mathlib/Logic/Basic.lean
forall_prop_congr
null
forall_prop_congr' {p p' : Prop} {q q' : p → Prop} (hq : ∀ h, q h ↔ q' h) (hp : p ↔ p') : (∀ h, q h) = ∀ h : p', q' (hp.2 h) := propext (forall_prop_congr hq hp)
theorem
Logic
[ "Mathlib.Tactic.Attr.Register", "Mathlib.Tactic.AdaptationNote", "Mathlib.Tactic.Basic", "Batteries.Logic", "Batteries.Tactic.Trans", "Batteries.Util.LibraryNote", "Mathlib.Data.Nat.Notation", "Mathlib.Data.Int.Notation" ]
Mathlib/Logic/Basic.lean
forall_prop_congr'
null
imp_congr_eq {a b c d : Prop} (h₁ : a = c) (h₂ : b = d) : (a → b) = (c → d) := propext (imp_congr h₁.to_iff h₂.to_iff)
lemma
Logic
[ "Mathlib.Tactic.Attr.Register", "Mathlib.Tactic.AdaptationNote", "Mathlib.Tactic.Basic", "Batteries.Logic", "Batteries.Tactic.Trans", "Batteries.Util.LibraryNote", "Mathlib.Data.Nat.Notation", "Mathlib.Data.Int.Notation" ]
Mathlib/Logic/Basic.lean
imp_congr_eq
null
imp_congr_ctx_eq {a b c d : Prop} (h₁ : a = c) (h₂ : c → b = d) : (a → b) = (c → d) := propext (imp_congr_ctx h₁.to_iff fun hc ↦ (h₂ hc).to_iff)
lemma
Logic
[ "Mathlib.Tactic.Attr.Register", "Mathlib.Tactic.AdaptationNote", "Mathlib.Tactic.Basic", "Batteries.Logic", "Batteries.Tactic.Trans", "Batteries.Util.LibraryNote", "Mathlib.Data.Nat.Notation", "Mathlib.Data.Int.Notation" ]
Mathlib/Logic/Basic.lean
imp_congr_ctx_eq
null
eq_true_intro {a : Prop} (h : a) : a = True := propext (iff_true_intro h)
lemma
Logic
[ "Mathlib.Tactic.Attr.Register", "Mathlib.Tactic.AdaptationNote", "Mathlib.Tactic.Basic", "Batteries.Logic", "Batteries.Tactic.Trans", "Batteries.Util.LibraryNote", "Mathlib.Data.Nat.Notation", "Mathlib.Data.Int.Notation" ]
Mathlib/Logic/Basic.lean
eq_true_intro
null
eq_false_intro {a : Prop} (h : ¬a) : a = False := propext (iff_false_intro h) @[nolint defLemma] alias Iff.eq := propext
lemma
Logic
[ "Mathlib.Tactic.Attr.Register", "Mathlib.Tactic.AdaptationNote", "Mathlib.Tactic.Basic", "Batteries.Logic", "Batteries.Tactic.Trans", "Batteries.Util.LibraryNote", "Mathlib.Data.Nat.Notation", "Mathlib.Data.Int.Notation" ]
Mathlib/Logic/Basic.lean
eq_false_intro
null
iff_eq_eq {a b : Prop} : (a ↔ b) = (a = b) := propext ⟨propext, Eq.to_iff⟩
lemma
Logic
[ "Mathlib.Tactic.Attr.Register", "Mathlib.Tactic.AdaptationNote", "Mathlib.Tactic.Basic", "Batteries.Logic", "Batteries.Tactic.Trans", "Batteries.Util.LibraryNote", "Mathlib.Data.Nat.Notation", "Mathlib.Data.Int.Notation" ]
Mathlib/Logic/Basic.lean
iff_eq_eq
null
@[simp] forall_true_left (p : True → Prop) : (∀ x, p x) ↔ p True.intro := forall_prop_of_true _
theorem
Logic
[ "Mathlib.Tactic.Attr.Register", "Mathlib.Tactic.AdaptationNote", "Mathlib.Tactic.Basic", "Batteries.Logic", "Batteries.Tactic.Trans", "Batteries.Util.LibraryNote", "Mathlib.Data.Nat.Notation", "Mathlib.Data.Int.Notation" ]
Mathlib/Logic/Basic.lean
forall_true_left
See `IsEmpty.forall_iff` for the `False` version.
noncomputable dec (p : Prop) : Decidable p := by infer_instance variable {α : Sort*}
def
Logic
[ "Mathlib.Tactic.Attr.Register", "Mathlib.Tactic.AdaptationNote", "Mathlib.Tactic.Basic", "Batteries.Logic", "Batteries.Tactic.Trans", "Batteries.Util.LibraryNote", "Mathlib.Data.Nat.Notation", "Mathlib.Data.Int.Notation" ]
Mathlib/Logic/Basic.lean
dec
Any prop `p` is decidable classically. A shorthand for `Classical.propDecidable`.
noncomputable decPred (p : α → Prop) : DecidablePred p := by infer_instance
def
Logic
[ "Mathlib.Tactic.Attr.Register", "Mathlib.Tactic.AdaptationNote", "Mathlib.Tactic.Basic", "Batteries.Logic", "Batteries.Tactic.Trans", "Batteries.Util.LibraryNote", "Mathlib.Data.Nat.Notation", "Mathlib.Data.Int.Notation" ]
Mathlib/Logic/Basic.lean
decPred
Any predicate `p` is decidable classically.
noncomputable decRel (p : α → α → Prop) : DecidableRel p := by infer_instance
def
Logic
[ "Mathlib.Tactic.Attr.Register", "Mathlib.Tactic.AdaptationNote", "Mathlib.Tactic.Basic", "Batteries.Logic", "Batteries.Tactic.Trans", "Batteries.Util.LibraryNote", "Mathlib.Data.Nat.Notation", "Mathlib.Data.Int.Notation" ]
Mathlib/Logic/Basic.lean
decRel
Any relation `p` is decidable classically.
noncomputable decEq (α : Sort*) : DecidableEq α := by infer_instance
def
Logic
[ "Mathlib.Tactic.Attr.Register", "Mathlib.Tactic.AdaptationNote", "Mathlib.Tactic.Basic", "Batteries.Logic", "Batteries.Tactic.Trans", "Batteries.Util.LibraryNote", "Mathlib.Data.Nat.Notation", "Mathlib.Data.Int.Notation" ]
Mathlib/Logic/Basic.lean
decEq
Any type `α` has decidable equality classically.
noncomputable existsCases {α C : Sort*} {p : α → Prop} (H0 : C) (H : ∀ a, p a → C) : C := if h : ∃ a, p a then H (Classical.choose h) (Classical.choose_spec h) else H0
def
Logic
[ "Mathlib.Tactic.Attr.Register", "Mathlib.Tactic.AdaptationNote", "Mathlib.Tactic.Basic", "Batteries.Logic", "Batteries.Tactic.Trans", "Batteries.Util.LibraryNote", "Mathlib.Data.Nat.Notation", "Mathlib.Data.Int.Notation" ]
Mathlib/Logic/Basic.lean
existsCases
Construct a function from a default value `H0`, and a function to use if there exists a value satisfying the predicate.
some_spec₂ {α : Sort*} {p : α → Prop} {h : ∃ a, p a} (q : α → Prop) (hpq : ∀ a, p a → q a) : q (choose h) := hpq _ <| choose_spec _
theorem
Logic
[ "Mathlib.Tactic.Attr.Register", "Mathlib.Tactic.AdaptationNote", "Mathlib.Tactic.Basic", "Batteries.Logic", "Batteries.Tactic.Trans", "Batteries.Util.LibraryNote", "Mathlib.Data.Nat.Notation", "Mathlib.Data.Int.Notation" ]
Mathlib/Logic/Basic.lean
some_spec₂
null
protected noncomputable byContradiction' {α : Sort*} (H : ¬(α → False)) : α := Classical.choice <| (peirce _ False) fun h ↦ (H fun a ↦ h ⟨a⟩).elim
def
Logic
[ "Mathlib.Tactic.Attr.Register", "Mathlib.Tactic.AdaptationNote", "Mathlib.Tactic.Basic", "Batteries.Logic", "Batteries.Tactic.Trans", "Batteries.Util.LibraryNote", "Mathlib.Data.Nat.Notation", "Mathlib.Data.Int.Notation" ]
Mathlib/Logic/Basic.lean
byContradiction'
A version of `byContradiction` that uses types instead of propositions.
choice_of_byContradiction' {α : Sort*} (contra : ¬(α → False) → α) : Nonempty α → α := fun H ↦ contra H.elim @[simp] lemma choose_eq (a : α) : @Exists.choose _ (· = a) ⟨a, rfl⟩ = a := @choose_spec _ (· = a) _ @[simp]
def
Logic
[ "Mathlib.Tactic.Attr.Register", "Mathlib.Tactic.AdaptationNote", "Mathlib.Tactic.Basic", "Batteries.Logic", "Batteries.Tactic.Trans", "Batteries.Util.LibraryNote", "Mathlib.Data.Nat.Notation", "Mathlib.Data.Int.Notation" ]
Mathlib/Logic/Basic.lean
choice_of_byContradiction'
`Classical.byContradiction'` is equivalent to lean's axiom `Classical.choice`.
choose_eq' (a : α) : @Exists.choose _ (a = ·) ⟨a, rfl⟩ = a := (@choose_spec _ (a = ·) _).symm alias axiom_of_choice := axiomOfChoice -- TODO: remove? rename in core? alias by_cases := byCases -- TODO: remove? rename in core? alias by_contradiction := byContradiction -- TODO: remove? rename in core? alias prop_complete := propComplete -- TODO: remove? rename in core?
lemma
Logic
[ "Mathlib.Tactic.Attr.Register", "Mathlib.Tactic.AdaptationNote", "Mathlib.Tactic.Basic", "Batteries.Logic", "Batteries.Tactic.Trans", "Batteries.Util.LibraryNote", "Mathlib.Data.Nat.Notation", "Mathlib.Data.Int.Notation" ]
Mathlib/Logic/Basic.lean
choose_eq'
null
noncomputable Exists.classicalRecOn {α : Sort*} {p : α → Prop} (h : ∃ a, p a) {C : Sort*} (H : ∀ a, p a → C) : C := H (Classical.choose h) (Classical.choose_spec h) /-! ### Declarations about bounded quantifiers -/
def
Logic
[ "Mathlib.Tactic.Attr.Register", "Mathlib.Tactic.AdaptationNote", "Mathlib.Tactic.Basic", "Batteries.Logic", "Batteries.Tactic.Trans", "Batteries.Util.LibraryNote", "Mathlib.Data.Nat.Notation", "Mathlib.Data.Int.Notation" ]
Mathlib/Logic/Basic.lean
Exists.classicalRecOn
This function has the same type as `Exists.recOn`, and can be used to case on an equality, but `Exists.recOn` can only eliminate into Prop, while this version eliminates into any universe using the axiom of choice.
bex_def : (∃ (x : _) (_ : p x), q x) ↔ ∃ x, p x ∧ q x := ⟨fun ⟨x, px, qx⟩ ↦ ⟨x, px, qx⟩, fun ⟨x, px, qx⟩ ↦ ⟨x, px, qx⟩⟩
theorem
Logic
[ "Mathlib.Tactic.Attr.Register", "Mathlib.Tactic.AdaptationNote", "Mathlib.Tactic.Basic", "Batteries.Logic", "Batteries.Tactic.Trans", "Batteries.Util.LibraryNote", "Mathlib.Data.Nat.Notation", "Mathlib.Data.Int.Notation" ]
Mathlib/Logic/Basic.lean
bex_def
null
BEx.elim {b : Prop} : (∃ x h, P x h) → (∀ a h, P a h → b) → b | ⟨a, h₁, h₂⟩, h' => h' a h₁ h₂
theorem
Logic
[ "Mathlib.Tactic.Attr.Register", "Mathlib.Tactic.AdaptationNote", "Mathlib.Tactic.Basic", "Batteries.Logic", "Batteries.Tactic.Trans", "Batteries.Util.LibraryNote", "Mathlib.Data.Nat.Notation", "Mathlib.Data.Int.Notation" ]
Mathlib/Logic/Basic.lean
BEx.elim
null
BEx.intro (a : α) (h₁ : p a) (h₂ : P a h₁) : ∃ (x : _) (h : p x), P x h := ⟨a, h₁, h₂⟩
theorem
Logic
[ "Mathlib.Tactic.Attr.Register", "Mathlib.Tactic.AdaptationNote", "Mathlib.Tactic.Basic", "Batteries.Logic", "Batteries.Tactic.Trans", "Batteries.Util.LibraryNote", "Mathlib.Data.Nat.Notation", "Mathlib.Data.Int.Notation" ]
Mathlib/Logic/Basic.lean
BEx.intro
null
BAll.imp_right (H : ∀ x h, P x h → Q x h) (h₁ : ∀ x h, P x h) (x h) : Q x h := H _ _ <| h₁ _ _
theorem
Logic
[ "Mathlib.Tactic.Attr.Register", "Mathlib.Tactic.AdaptationNote", "Mathlib.Tactic.Basic", "Batteries.Logic", "Batteries.Tactic.Trans", "Batteries.Util.LibraryNote", "Mathlib.Data.Nat.Notation", "Mathlib.Data.Int.Notation" ]
Mathlib/Logic/Basic.lean
BAll.imp_right
null
BEx.imp_right (H : ∀ x h, P x h → Q x h) : (∃ x h, P x h) → ∃ x h, Q x h | ⟨_, _, h'⟩ => ⟨_, _, H _ _ h'⟩
theorem
Logic
[ "Mathlib.Tactic.Attr.Register", "Mathlib.Tactic.AdaptationNote", "Mathlib.Tactic.Basic", "Batteries.Logic", "Batteries.Tactic.Trans", "Batteries.Util.LibraryNote", "Mathlib.Data.Nat.Notation", "Mathlib.Data.Int.Notation" ]
Mathlib/Logic/Basic.lean
BEx.imp_right
null
BAll.imp_left (H : ∀ x, p x → q x) (h₁ : ∀ x, q x → r x) (x) (h : p x) : r x := h₁ _ <| H _ h
theorem
Logic
[ "Mathlib.Tactic.Attr.Register", "Mathlib.Tactic.AdaptationNote", "Mathlib.Tactic.Basic", "Batteries.Logic", "Batteries.Tactic.Trans", "Batteries.Util.LibraryNote", "Mathlib.Data.Nat.Notation", "Mathlib.Data.Int.Notation" ]
Mathlib/Logic/Basic.lean
BAll.imp_left
null
BEx.imp_left (H : ∀ x, p x → q x) : (∃ (x : _) (_ : p x), r x) → ∃ (x : _) (_ : q x), r x | ⟨x, hp, hr⟩ => ⟨x, H _ hp, hr⟩
theorem
Logic
[ "Mathlib.Tactic.Attr.Register", "Mathlib.Tactic.AdaptationNote", "Mathlib.Tactic.Basic", "Batteries.Logic", "Batteries.Tactic.Trans", "Batteries.Util.LibraryNote", "Mathlib.Data.Nat.Notation", "Mathlib.Data.Int.Notation" ]
Mathlib/Logic/Basic.lean
BEx.imp_left
null
exists_mem_of_exists (H : ∀ x, p x) : (∃ x, q x) → ∃ (x : _) (_ : p x), q x | ⟨x, hq⟩ => ⟨x, H x, hq⟩
theorem
Logic
[ "Mathlib.Tactic.Attr.Register", "Mathlib.Tactic.AdaptationNote", "Mathlib.Tactic.Basic", "Batteries.Logic", "Batteries.Tactic.Trans", "Batteries.Util.LibraryNote", "Mathlib.Data.Nat.Notation", "Mathlib.Data.Int.Notation" ]
Mathlib/Logic/Basic.lean
exists_mem_of_exists
null
exists_of_exists_mem : (∃ (x : _) (_ : p x), q x) → ∃ x, q x | ⟨x, _, hq⟩ => ⟨x, hq⟩
theorem
Logic
[ "Mathlib.Tactic.Attr.Register", "Mathlib.Tactic.AdaptationNote", "Mathlib.Tactic.Basic", "Batteries.Logic", "Batteries.Tactic.Trans", "Batteries.Util.LibraryNote", "Mathlib.Data.Nat.Notation", "Mathlib.Data.Int.Notation" ]
Mathlib/Logic/Basic.lean
exists_of_exists_mem
null
not_exists_mem : (¬∃ x h, P x h) ↔ ∀ x h, ¬P x h := exists₂_imp
theorem
Logic
[ "Mathlib.Tactic.Attr.Register", "Mathlib.Tactic.AdaptationNote", "Mathlib.Tactic.Basic", "Batteries.Logic", "Batteries.Tactic.Trans", "Batteries.Util.LibraryNote", "Mathlib.Data.Nat.Notation", "Mathlib.Data.Int.Notation" ]
Mathlib/Logic/Basic.lean
not_exists_mem
null
not_forall₂_of_exists₂_not : (∃ x h, ¬P x h) → ¬∀ x h, P x h | ⟨x, h, hp⟩, al => hp <| al x h
theorem
Logic
[ "Mathlib.Tactic.Attr.Register", "Mathlib.Tactic.AdaptationNote", "Mathlib.Tactic.Basic", "Batteries.Logic", "Batteries.Tactic.Trans", "Batteries.Util.LibraryNote", "Mathlib.Data.Nat.Notation", "Mathlib.Data.Int.Notation" ]
Mathlib/Logic/Basic.lean
not_forall₂_of_exists₂_not
null
protected Decidable.not_forall₂ [Decidable (∃ x h, ¬P x h)] [∀ x h, Decidable (P x h)] : (¬∀ x h, P x h) ↔ ∃ x h, ¬P x h := ⟨Not.decidable_imp_symm fun nx x h ↦ nx.decidable_imp_symm fun h' ↦ ⟨x, h, h'⟩, not_forall₂_of_exists₂_not⟩
theorem
Logic
[ "Mathlib.Tactic.Attr.Register", "Mathlib.Tactic.AdaptationNote", "Mathlib.Tactic.Basic", "Batteries.Logic", "Batteries.Tactic.Trans", "Batteries.Util.LibraryNote", "Mathlib.Data.Nat.Notation", "Mathlib.Data.Int.Notation" ]
Mathlib/Logic/Basic.lean
Decidable.not_forall₂
null
not_forall₂ : (¬∀ x h, P x h) ↔ ∃ x h, ¬P x h := open scoped Classical in Decidable.not_forall₂
theorem
Logic
[ "Mathlib.Tactic.Attr.Register", "Mathlib.Tactic.AdaptationNote", "Mathlib.Tactic.Basic", "Batteries.Logic", "Batteries.Tactic.Trans", "Batteries.Util.LibraryNote", "Mathlib.Data.Nat.Notation", "Mathlib.Data.Int.Notation" ]
Mathlib/Logic/Basic.lean
not_forall₂
null
forall₂_and : (∀ x h, P x h ∧ Q x h) ↔ (∀ x h, P x h) ∧ ∀ x h, Q x h := Iff.trans (forall_congr' fun _ ↦ forall_and) forall_and
theorem
Logic
[ "Mathlib.Tactic.Attr.Register", "Mathlib.Tactic.AdaptationNote", "Mathlib.Tactic.Basic", "Batteries.Logic", "Batteries.Tactic.Trans", "Batteries.Util.LibraryNote", "Mathlib.Data.Nat.Notation", "Mathlib.Data.Int.Notation" ]
Mathlib/Logic/Basic.lean
forall₂_and
null
forall_and_left [Nonempty α] (q : Prop) (p : α → Prop) : (∀ x, q ∧ p x) ↔ (q ∧ ∀ x, p x) := by rw [forall_and, forall_const]
theorem
Logic
[ "Mathlib.Tactic.Attr.Register", "Mathlib.Tactic.AdaptationNote", "Mathlib.Tactic.Basic", "Batteries.Logic", "Batteries.Tactic.Trans", "Batteries.Util.LibraryNote", "Mathlib.Data.Nat.Notation", "Mathlib.Data.Int.Notation" ]
Mathlib/Logic/Basic.lean
forall_and_left
null
forall_and_right [Nonempty α] (p : α → Prop) (q : Prop) : (∀ x, p x ∧ q) ↔ (∀ x, p x) ∧ q := by rw [forall_and, forall_const]
theorem
Logic
[ "Mathlib.Tactic.Attr.Register", "Mathlib.Tactic.AdaptationNote", "Mathlib.Tactic.Basic", "Batteries.Logic", "Batteries.Tactic.Trans", "Batteries.Util.LibraryNote", "Mathlib.Data.Nat.Notation", "Mathlib.Data.Int.Notation" ]
Mathlib/Logic/Basic.lean
forall_and_right
null
exists_mem_or : (∃ x h, P x h ∨ Q x h) ↔ (∃ x h, P x h) ∨ ∃ x h, Q x h := Iff.trans (exists_congr fun _ ↦ exists_or) exists_or
theorem
Logic
[ "Mathlib.Tactic.Attr.Register", "Mathlib.Tactic.AdaptationNote", "Mathlib.Tactic.Basic", "Batteries.Logic", "Batteries.Tactic.Trans", "Batteries.Util.LibraryNote", "Mathlib.Data.Nat.Notation", "Mathlib.Data.Int.Notation" ]
Mathlib/Logic/Basic.lean
exists_mem_or
null
forall₂_or_left : (∀ x, p x ∨ q x → r x) ↔ (∀ x, p x → r x) ∧ ∀ x, q x → r x := Iff.trans (forall_congr' fun _ ↦ or_imp) forall_and
theorem
Logic
[ "Mathlib.Tactic.Attr.Register", "Mathlib.Tactic.AdaptationNote", "Mathlib.Tactic.Basic", "Batteries.Logic", "Batteries.Tactic.Trans", "Batteries.Util.LibraryNote", "Mathlib.Data.Nat.Notation", "Mathlib.Data.Int.Notation" ]
Mathlib/Logic/Basic.lean
forall₂_or_left
null
exists_mem_or_left : (∃ (x : _) (_ : p x ∨ q x), r x) ↔ (∃ (x : _) (_ : p x), r x) ∨ ∃ (x : _) (_ : q x), r x := by simp only [exists_prop] exact Iff.trans (exists_congr fun x ↦ or_and_right) exists_or
theorem
Logic
[ "Mathlib.Tactic.Attr.Register", "Mathlib.Tactic.AdaptationNote", "Mathlib.Tactic.Basic", "Batteries.Logic", "Batteries.Tactic.Trans", "Batteries.Util.LibraryNote", "Mathlib.Data.Nat.Notation", "Mathlib.Data.Int.Notation" ]
Mathlib/Logic/Basic.lean
exists_mem_or_left
null
dite_eq_iff : dite P A B = c ↔ (∃ h, A h = c) ∨ ∃ h, B h = c := by by_cases P <;> simp [*, exists_prop_of_true, exists_prop_of_false]
theorem
Logic
[ "Mathlib.Tactic.Attr.Register", "Mathlib.Tactic.AdaptationNote", "Mathlib.Tactic.Basic", "Batteries.Logic", "Batteries.Tactic.Trans", "Batteries.Util.LibraryNote", "Mathlib.Data.Nat.Notation", "Mathlib.Data.Int.Notation" ]
Mathlib/Logic/Basic.lean
dite_eq_iff
null
ite_eq_iff : ite P a b = c ↔ P ∧ a = c ∨ ¬P ∧ b = c := dite_eq_iff.trans <| by rw [exists_prop, exists_prop]
theorem
Logic
[ "Mathlib.Tactic.Attr.Register", "Mathlib.Tactic.AdaptationNote", "Mathlib.Tactic.Basic", "Batteries.Logic", "Batteries.Tactic.Trans", "Batteries.Util.LibraryNote", "Mathlib.Data.Nat.Notation", "Mathlib.Data.Int.Notation" ]
Mathlib/Logic/Basic.lean
ite_eq_iff
null