# Documentation

## Batteries.Logic

instance instDecidablePredComp_batteries {α : Sort u_1} {β : Sort u_2} {p : βProp} {f : αβ} [] :
Equations
@[deprecated proof_irrel]
theorem proofIrrel {a : Prop} (h₁ : a) (h₂ : a) :
h₁ = h₂

Alias of proof_irrel.

## id #

theorem Function.id_def {α : Sort u_1} :
id = fun (x : α) => x

## exists and forall #

theorem forall_not_of_not_exists {α : Sort u_1} {p : αProp} :
(¬∃ (x : α), p x)∀ (x : α), ¬p x

Alias of the forward direction of not_exists.

theorem not_exists_of_forall_not {α : Sort u_1} {p : αProp} :
(∀ (x : α), ¬p x)¬∃ (x : α), p x

Alias of the reverse direction of not_exists.

## decidable #

theorem Decidable.exists_not_of_not_forall {α : Sort u_1} {p : αProp} [Decidable (∃ (x : α), ¬p x)] [(x : α) → Decidable (p x)] :
(¬∀ (x : α), p x)∃ (x : α), ¬p x

Alias of the forward direction of Decidable.not_forall.

## classical logic #

theorem Classical.exists_not_of_not_forall {α : Sort u_1} {p : αProp} :
(¬∀ (x : α), p x)∃ (x : α), ¬p x

Alias of the forward direction of Classical.not_forall.

## equality #

theorem heq_iff_eq :
∀ {α : Sort u_1} {a b : α}, HEq a b a = b
@[simp]
theorem eq_rec_constant {α : Sort u_1} {a : α} {a' : α} {β : Sort u_2} (y : β) (h : a = a') :
hy = y
theorem congrArg₂ {α : Sort u_1} {β : Sort u_2} {γ : Sort u_3} (f : αβγ) {x : α} {x' : α} {y : β} {y' : β} (hx : x = x') (hy : y = y') :
f x y = f x' y'
theorem congrFun₂ {α : Sort u_1} {β : αSort u_2} {γ : (a : α) → β aSort u_3} {f : (a : α) → (b : β a) → γ a b} {g : (a : α) → (b : β a) → γ a b} (h : f = g) (a : α) (b : β a) :
f a b = g a b
theorem congrFun₃ {α : Sort u_1} {β : αSort u_2} {γ : (a : α) → β aSort u_3} {δ : (a : α) → (b : β a) → γ a bSort u_4} {f : (a : α) → (b : β a) → (c : γ a b) → δ a b c} {g : (a : α) → (b : β a) → (c : γ a b) → δ a b c} (h : f = g) (a : α) (b : β a) (c : γ a b) :
f a b c = g a b c
theorem funext₂ {α : Sort u_1} {β : αSort u_2} {γ : (a : α) → β aSort u_3} {f : (a : α) → (b : β a) → γ a b} {g : (a : α) → (b : β a) → γ a b} (h : ∀ (a : α) (b : β a), f a b = g a b) :
f = g
theorem funext₃ {α : Sort u_1} {β : αSort u_2} {γ : (a : α) → β aSort u_3} {δ : (a : α) → (b : β a) → γ a bSort u_4} {f : (a : α) → (b : β a) → (c : γ a b) → δ a b c} {g : (a : α) → (b : β a) → (c : γ a b) → δ a b c} (h : ∀ (a : α) (b : β a) (c : γ a b), f a b c = g a b c) :
f = g
theorem Function.funext_iff {α : Sort u_1} {β : αSort u} {f₁ : (x : α) → β x} {f₂ : (x : α) → β x} :
f₁ = f₂ ∀ (a : α), f₁ a = f₂ a
theorem ne_of_apply_ne {α : Sort u_1} {β : Sort u_2} (f : αβ) {x : α} {y : α} :
f x f yx y
theorem Eq.congr :
∀ {α : Sort u_1} {x₁ y₁ x₂ y₂ : α}, x₁ = y₁x₂ = y₂(x₁ = x₂ y₁ = y₂)
theorem Eq.congr_left {α : Sort u_1} {x : α} {y : α} {z : α} (h : x = y) :
x = z y = z
theorem Eq.congr_right {α : Sort u_1} {x : α} {y : α} {z : α} (h : x = y) :
z = x z = y
theorem congr_arg {α : Sort u} {β : Sort v} {a₁ : α} {a₂ : α} (f : αβ) (h : a₁ = a₂) :
f a₁ = f a₂

Alias of congrArg.

Congruence in the function argument: if a₁ = a₂ then f a₁ = f a₂ for any (nondependent) function f. This is more powerful than it might look at first, because you can also use a lambda expression for f to prove that <something containing a₁> = <something containing a₂>. This function is used internally by tactics like congr and simp to apply equalities inside subterms.

theorem congr_arg₂ {α : Sort u_1} {β : Sort u_2} {γ : Sort u_3} (f : αβγ) {x : α} {x' : α} {y : β} {y' : β} (hx : x = x') (hy : y = y') :
f x y = f x' y'

Alias of congrArg₂.

theorem congr_fun {α : Sort u} {β : αSort v} {f : (x : α) → β x} {g : (x : α) → β x} (h : f = g) (a : α) :
f a = g a

Alias of congrFun.

Congruence in the function part of an application: If f = g then f a = g a.

theorem congr_fun₂ {α : Sort u_1} {β : αSort u_2} {γ : (a : α) → β aSort u_3} {f : (a : α) → (b : β a) → γ a b} {g : (a : α) → (b : β a) → γ a b} (h : f = g) (a : α) (b : β a) :
f a b = g a b

Alias of congrFun₂.

theorem congr_fun₃ {α : Sort u_1} {β : αSort u_2} {γ : (a : α) → β aSort u_3} {δ : (a : α) → (b : β a) → γ a bSort u_4} {f : (a : α) → (b : β a) → (c : γ a b) → δ a b c} {g : (a : α) → (b : β a) → (c : γ a b) → δ a b c} (h : f = g) (a : α) (b : β a) (c : γ a b) :
f a b c = g a b c

Alias of congrFun₃.

theorem heq_of_cast_eq {α : Sort u_1} {β : Sort u_1} {a : α} {a' : β} (e : α = β) :
cast e a = a'HEq a a'
theorem cast_eq_iff_heq :
∀ {a a_1 : Sort u_1} {e : a = a_1} {a_2 : a} {a' : a_1}, cast e a_2 = a' HEq a_2 a'
theorem eqRec_eq_cast {α : Sort u_1} {a : α} {motive : (a' : α) → a = a'Sort u_2} (x : motive a ) {a' : α} (e : a = a') :
ex = cast x
theorem eqRec_heq_self {α : Sort u_1} {a : α} {motive : (a' : α) → a = a'Sort u_2} (x : motive a ) {a' : α} (e : a = a') :
HEq (ex) x
@[simp]
theorem eqRec_heq_iff_heq {α : Sort u_1} {a : α} {motive : (a' : α) → a = a'Sort u_2} (x : motive a ) {a' : α} (e : a = a') {β : Sort u_2} (y : β) :
HEq (ex) y HEq x y
@[simp]
theorem heq_eqRec_iff_heq {α : Sort u_1} {a : α} {motive : (a' : α) → a = a'Sort u_2} (x : motive a ) {a' : α} (e : a = a') {β : Sort u_2} (y : β) :
HEq y (ex) HEq y x

## membership #

theorem ne_of_mem_of_not_mem {α : Type u_1} {β : Type u_2} [] {s : β} {a : α} {b : α} (h : a s) :
¬b sa b
theorem ne_of_mem_of_not_mem' {α : Type u_1} {β : Type u_2} [] {s : β} {t : β} {a : α} (h : a s) :
¬a ts t

## miscellaneous #

@[simp]
@[simp]
theorem eq_iff_true_of_subsingleton {α : Sort u_1} [] (x : α) (y : α) :
x = y True
theorem subsingleton_of_forall_eq {α : Sort u_1} (x : α) (h : ∀ (y : α), y = x) :

If all points are equal to a given point x, then α is a subsingleton.

theorem subsingleton_iff_forall_eq {α : Sort u_1} (x : α) :
∀ (y : α), y = x
theorem congr_eqRec {α : Sort u_1} {γ : Sort u_2} {x : α} {x' : α} {β : αSort u_3} (f : (x : α) → β xγ) (h : x = x') (y : β x) :
f x' (hy) = f x y