statement
stringlengths
1
8.65k
proof
stringlengths
0
19.6k
type
stringclasses
12 values
symbolic_name
stringlengths
1
110
library
stringclasses
165 values
filename
stringclasses
822 values
imports
listlengths
0
19
deps
listlengths
0
64
docstring
stringlengths
0
3.64k
source_url
stringclasses
1 value
commit
stringclasses
1 value
of_iff_true (h : a ↔ True) : a
h.mpr trivial
theorem
of_iff_true
Init
src/Init/Core.lean
[]
[ "True", "trivial" ]
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
iff_true_intro (h : a) : a ↔ True
iff_of_true h trivial
theorem
iff_true_intro
Init
src/Init/Core.lean
[]
[ "True", "iff_of_true", "trivial" ]
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
eq_iff_true_of_subsingleton [Subsingleton α] (x y : α) : x = y ↔ True
iff_true_intro (Subsingleton.elim ..)
theorem
eq_iff_true_of_subsingleton
Init
src/Init/Core.lean
[]
[ "Subsingleton", "Subsingleton.elim", "True", "iff_true_intro" ]
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
not_of_iff_false : (p ↔ False) → ¬p
Iff.mp
theorem
not_of_iff_false
Init
src/Init/Core.lean
[]
[ "False" ]
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
iff_false_intro (h : ¬a) : a ↔ False
iff_of_false h id
theorem
iff_false_intro
Init
src/Init/Core.lean
[]
[ "False", "id", "iff_of_false" ]
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
not_iff_false_intro (h : a) : ¬a ↔ False
iff_false_intro (not_not_intro h)
theorem
not_iff_false_intro
Init
src/Init/Core.lean
[]
[ "False", "iff_false_intro", "not_not_intro" ]
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
not_true : (¬True) ↔ False
iff_false_intro (not_not_intro trivial)
theorem
not_true
Init
src/Init/Core.lean
[]
[ "False", "True", "iff_false_intro", "not_not_intro", "trivial" ]
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
not_false_iff : (¬False) ↔ True
iff_true_intro not_false
theorem
not_false_iff
Init
src/Init/Core.lean
[]
[ "False", "True", "iff_true_intro", "not_false" ]
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
Eq.to_iff : a = b → (a ↔ b)
Iff.of_eq
theorem
Eq.to_iff
Init
src/Init/Core.lean
[]
[ "Iff.of_eq" ]
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
iff_of_eq : a = b → (a ↔ b)
Iff.of_eq
theorem
iff_of_eq
Init
src/Init/Core.lean
[]
[ "Iff.of_eq" ]
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
neq_of_not_iff : ¬(a ↔ b) → a ≠ b
mt Iff.of_eq
theorem
neq_of_not_iff
Init
src/Init/Core.lean
[]
[ "Iff.of_eq", "mt" ]
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
iff_iff_eq : (a ↔ b) ↔ a = b
Iff.intro propext Iff.of_eq
theorem
iff_iff_eq
Init
src/Init/Core.lean
[]
[ "Iff.of_eq", "propext" ]
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
eq_iff_iff : (a = b) ↔ (a ↔ b)
iff_iff_eq.symm
theorem
eq_iff_iff
Init
src/Init/Core.lean
[]
[]
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
eq_self_iff_true (a : α) : a = a ↔ True
iff_true_intro rfl
theorem
eq_self_iff_true
Init
src/Init/Core.lean
[]
[ "True", "iff_true_intro", "rfl" ]
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
ne_self_iff_false (a : α) : a ≠ a ↔ False
not_iff_false_intro rfl
theorem
ne_self_iff_false
Init
src/Init/Core.lean
[]
[ "False", "not_iff_false_intro", "rfl" ]
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
false_of_true_iff_false (h : True ↔ False) : False
h.mp trivial
theorem
false_of_true_iff_false
Init
src/Init/Core.lean
[]
[ "False", "True", "trivial" ]
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
false_of_true_eq_false (h : True = False) : False
false_of_true_iff_false (Iff.of_eq h)
theorem
false_of_true_eq_false
Init
src/Init/Core.lean
[]
[ "False", "Iff.of_eq", "True", "false_of_true_iff_false" ]
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
true_eq_false_of_false : False → (True = False)
False.elim
theorem
true_eq_false_of_false
Init
src/Init/Core.lean
[]
[ "False", "False.elim", "True" ]
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
iff_def : (a ↔ b) ↔ (a → b) ∧ (b → a)
iff_iff_implies_and_implies
theorem
iff_def
Init
src/Init/Core.lean
[]
[ "iff_iff_implies_and_implies" ]
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
iff_def' : (a ↔ b) ↔ (b → a) ∧ (a → b)
Iff.trans iff_def And.comm
theorem
iff_def'
Init
src/Init/Core.lean
[]
[ "And.comm", "Iff.trans", "iff_def" ]
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
true_iff_false : (True ↔ False) ↔ False
iff_false_intro (·.mp True.intro)
theorem
true_iff_false
Init
src/Init/Core.lean
[]
[ "False", "True", "iff_false_intro" ]
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
false_iff_true : (False ↔ True) ↔ False
iff_false_intro (·.mpr True.intro)
theorem
false_iff_true
Init
src/Init/Core.lean
[]
[ "False", "True", "iff_false_intro" ]
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
iff_not_self : ¬(a ↔ ¬a) | H => let f h
H.1 h h; f (H.2 f)
theorem
iff_not_self
Init
src/Init/Core.lean
[]
[]
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
heq_self_iff_true (a : α) : a ≍ a ↔ True
iff_true_intro HEq.rfl
theorem
heq_self_iff_true
Init
src/Init/Core.lean
[]
[ "HEq.rfl", "True", "iff_true_intro" ]
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
not_not_of_not_imp : ¬(a → b) → ¬¬a
mt Not.elim
theorem
not_not_of_not_imp
Init
src/Init/Core.lean
[]
[ "Not.elim", "mt" ]
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
not_of_not_imp {a : Prop} : ¬(a → b) → ¬b
mt fun h _ => h
theorem
not_of_not_imp
Init
src/Init/Core.lean
[]
[ "mt" ]
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
imp_not_self : (a → ¬a) ↔ ¬a
Iff.intro (fun h ha => h ha ha) (fun h _ => h)
theorem
imp_not_self
Init
src/Init/Core.lean
[]
[]
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
imp_intro {α β : Prop} (h : α) : β → α
fun _ => h
theorem
imp_intro
Init
src/Init/Core.lean
[]
[]
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
imp_imp_imp {a b c d : Prop} (h₀ : c → a) (h₁ : b → d) : (a → b) → (c → d)
(h₁ ∘ · ∘ h₀)
theorem
imp_imp_imp
Init
src/Init/Core.lean
[]
[]
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
imp_iff_right {a : Prop} (ha : a) : (a → b) ↔ b
Iff.intro (· ha) (fun a _ => a)
theorem
imp_iff_right
Init
src/Init/Core.lean
[]
[]
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
imp_true_iff (α : Sort u) : (α → True) ↔ True
iff_true_intro (fun _ => trivial)
theorem
imp_true_iff
Init
src/Init/Core.lean
[]
[ "True", "iff_true_intro", "trivial" ]
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
false_imp_iff (a : Prop) : (False → a) ↔ True
iff_true_intro False.elim
theorem
false_imp_iff
Init
src/Init/Core.lean
[]
[ "False", "False.elim", "True", "iff_true_intro" ]
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
true_imp_iff {α : Prop} : (True → α) ↔ α
imp_iff_right True.intro
theorem
true_imp_iff
Init
src/Init/Core.lean
[]
[ "True", "imp_iff_right" ]
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
imp_self : (a → a) ↔ True
iff_true_intro id
theorem
imp_self
Init
src/Init/Core.lean
[]
[ "True", "id", "iff_true_intro" ]
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
imp_false : (a → False) ↔ ¬a
Iff.rfl
theorem
imp_false
Init
src/Init/Core.lean
[]
[ "False", "Iff.rfl" ]
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
imp.swap : (a → b → c) ↔ (b → a → c)
Iff.intro flip flip
theorem
imp.swap
Init
src/Init/Core.lean
[]
[ "flip" ]
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
imp_not_comm : (a → ¬b) ↔ (b → ¬a)
imp.swap
theorem
imp_not_comm
Init
src/Init/Core.lean
[]
[ "imp.swap" ]
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
imp_congr_left (h : a ↔ b) : (a → c) ↔ (b → c)
Iff.intro (· ∘ h.mpr) (· ∘ h.mp)
theorem
imp_congr_left
Init
src/Init/Core.lean
[]
[]
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
imp_congr_right (h : a → (b ↔ c)) : (a → b) ↔ (a → c)
Iff.intro (fun hab ha => (h ha).mp (hab ha)) (fun hcd ha => (h ha).mpr (hcd ha))
theorem
imp_congr_right
Init
src/Init/Core.lean
[]
[]
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
imp_congr_ctx (h₁ : a ↔ c) (h₂ : c → (b ↔ d)) : (a → b) ↔ (c → d)
Iff.trans (imp_congr_left h₁) (imp_congr_right h₂)
theorem
imp_congr_ctx
Init
src/Init/Core.lean
[]
[ "Iff.trans", "imp_congr_left", "imp_congr_right" ]
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
imp_congr (h₁ : a ↔ c) (h₂ : b ↔ d) : (a → b) ↔ (c → d)
imp_congr_ctx h₁ fun _ => h₂
theorem
imp_congr
Init
src/Init/Core.lean
[]
[ "imp_congr_ctx" ]
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
imp_iff_not (hb : ¬b) : a → b ↔ ¬a
imp_congr_right fun _ => iff_false_intro hb
theorem
imp_iff_not
Init
src/Init/Core.lean
[]
[ "iff_false_intro", "imp_congr_right" ]
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
sound : ∀ {α : Sort u} {r : α → α → Prop} {a b : α}, r a b → Quot.mk r a = Quot.mk r b
axiom
Quot.sound
Init
src/Init/Core.lean
[]
[]
The **quotient axiom**, which asserts the equality of elements related by the quotient's relation. The relation `r` does not need to be an equivalence relation to use this axiom. When `r` is not an equivalence relation, the quotient is with respect to the equivalence relation generated by `r`. `Quot.sound` is part of...
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
liftBeta {α : Sort u} {r : α → α → Prop} {β : Sort v} (f : α → β) (c : (a b : α) → r a b → f a = f b) (a : α) : lift f c (Quot.mk r a) = f a
rfl
theorem
Quot.liftBeta
Init
src/Init/Core.lean
[]
[ "rfl" ]
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
indBeta {α : Sort u} {r : α → α → Prop} {motive : Quot r → Prop} (p : (a : α) → motive (Quot.mk r a)) (a : α) : (ind p (Quot.mk r a) : motive (Quot.mk r a)) = p a
rfl
theorem
Quot.indBeta
Init
src/Init/Core.lean
[]
[ "rfl" ]
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
liftOn {α : Sort u} {β : Sort v} {r : α → α → Prop} (q : Quot r) (f : α → β) (c : (a b : α) → r a b → f a = f b) : β
lift f c q
abbrev
Quot.liftOn
Init
src/Init/Core.lean
[]
[]
Lifts a function from an underlying type to a function on a quotient, requiring that it respects the quotient's relation. Given a relation `r : α → α → Prop` and a quotient's value `q : Quot r`, applying a `f : α → β` requires a proof `c` that `f` respects `r`. In this case, `Quot.liftOn q f h : β` evaluates to the re...
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
inductionOn {α : Sort u} {r : α → α → Prop} {motive : Quot r → Prop} (q : Quot r) (h : (a : α) → motive (Quot.mk r a)) : motive q
ind h q
theorem
Quot.inductionOn
Init
src/Init/Core.lean
[]
[]
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
exists_rep {α : Sort u} {r : α → α → Prop} (q : Quot r) : Exists (fun a => (Quot.mk r a) = q)
q.inductionOn (fun a => ⟨a, rfl⟩)
theorem
Quot.exists_rep
Init
src/Init/Core.lean
[]
[ "Exists" ]
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
indep (f : (a : α) → motive (Quot.mk r a)) (a : α) : PSigma motive
⟨Quot.mk r a, f a⟩
def
Quot.indep
Init
src/Init/Core.lean
[]
[ "PSigma" ]
Auxiliary definition for `Quot.rec`.
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
indepCoherent (f : (a : α) → motive (Quot.mk r a)) (h : (a b : α) → (p : r a b) → Eq.ndrec (f a) (sound p) = f b) : (a b : α) → r a b → Quot.indep f a = Quot.indep f b
fun a b e => PSigma.eta (sound e) (h a b e)
theorem
Quot.indepCoherent
Init
src/Init/Core.lean
[]
[ "PSigma.eta", "Quot.indep" ]
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
liftIndepPr1 (f : (a : α) → motive (Quot.mk r a)) (h : ∀ (a b : α) (p : r a b), Eq.ndrec (f a) (sound p) = f b) (q : Quot r) : (lift (Quot.indep f) (Quot.indepCoherent f h) q).1 = q
by induction q using Quot.ind exact rfl
theorem
Quot.liftIndepPr1
Init
src/Init/Core.lean
[]
[ "Quot.indep", "Quot.indepCoherent", "rfl" ]
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
rec (f : (a : α) → motive (Quot.mk r a)) (h : (a b : α) → (p : r a b) → Eq.ndrec (f a) (sound p) = f b) (q : Quot r) : motive q
Eq.ndrecOn (Quot.liftIndepPr1 f h q) ((lift (Quot.indep f) (Quot.indepCoherent f h) q).2)
abbrev
Quot.rec
Init
src/Init/Core.lean
[]
[ "Quot.indep", "Quot.indepCoherent", "Quot.liftIndepPr1" ]
A dependent recursion principle for `Quot`. It is analogous to the [recursor](lean-manual://section/recursors) for a structure, and can be used when the resulting type is not necessarily a proposition. While it is very general, this recursor can be tricky to use. The following simpler alternatives may be easier to use...
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
recOn (q : Quot r) (f : (a : α) → motive (Quot.mk r a)) (h : (a b : α) → (p : r a b) → Eq.ndrec (f a) (sound p) = f b) : motive q
q.rec f h
abbrev
Quot.recOn
Init
src/Init/Core.lean
[]
[]
A dependent recursion principle for `Quot` that takes the quotient first. It is analogous to the [recursor](lean-manual://section/recursors) for a structure, and can be used when the resulting type is not necessarily a proposition. While it is very general, this recursor can be tricky to use. The following simpler alt...
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
recOnSubsingleton [h : (a : α) → Subsingleton (motive (Quot.mk r a))] (q : Quot r) (f : (a : α) → motive (Quot.mk r a)) : motive q
by induction q using Quot.rec apply f apply Subsingleton.elim
abbrev
Quot.recOnSubsingleton
Init
src/Init/Core.lean
[]
[ "Quot.rec", "Subsingleton", "Subsingleton.elim" ]
An alternative induction principle for quotients that can be used when the target type is a subsingleton, in which all elements are equal. In these cases, the proof that the function respects the quotient's relation is trivial, so any function can be lifted. `Quot.rec` does not assume that the type is a subsingleton.
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
hrecOn (q : Quot r) (f : (a : α) → motive (Quot.mk r a)) (c : (a b : α) → (p : r a b) → f a ≍ f b) : motive q
Quot.recOn q f fun a b p => eq_of_heq (eqRec_heq_iff.mpr (c a b p))
abbrev
Quot.hrecOn
Init
src/Init/Core.lean
[]
[ "Quot.recOn", "eq_of_heq" ]
A dependent recursion principle for `Quot` that uses [heterogeneous equality](lean-manual://section/HEq), analogous to a [recursor](lean-manual://section/recursors) for a structure. `Quot.recOn` is a version of this recursor that uses `Eq` instead of `HEq`.
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
Quotient {α : Sort u} (s : Setoid α)
@Quot α Setoid.r
def
Quotient
Init
src/Init/Core.lean
[]
[ "Setoid" ]
Quotient types coarsen the propositional equality for a type so that terms related by some equivalence relation are considered equal. The equivalence relation is given by an instance of `Setoid`. Set-theoretically, `Quotient s` can seen as the set of equivalence classes of `α` modulo the `Setoid` instance's relation `...
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
mk {α : Sort u} (s : Setoid α) (a : α) : Quotient s
Quot.mk Setoid.r a
def
Quotient.mk
Init
src/Init/Core.lean
[]
[ "Quotient", "Setoid" ]
Places an element of a type into the quotient that equates terms according to an equivalence relation. The setoid instance is provided explicitly. `Quotient.mk'` uses instance synthesis instead. Given `v : α`, `Quotient.mk s v : Quotient s` is like `v`, except all observations of `v`'s value must respect `s.r`. `Quot...
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
mk' {α : Sort u} [s : Setoid α] (a : α) : Quotient s
Quotient.mk s a
def
Quotient.mk'
Init
src/Init/Core.lean
[]
[ "Quotient", "Quotient.mk", "Setoid" ]
Places an element of a type into the quotient that equates terms according to an equivalence relation. The equivalence relation is found by synthesizing a `Setoid` instance. `Quotient.mk` instead expects the instance to be provided explicitly. Given `v : α`, `Quotient.mk' v : Quotient s` is like `v`, except all obser...
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
sound {α : Sort u} {s : Setoid α} {a b : α} : a ≈ b → Quotient.mk s a = Quotient.mk s b
Quot.sound
theorem
Quotient.sound
Init
src/Init/Core.lean
[]
[ "Quot.sound", "Quotient.mk", "Setoid" ]
The **quotient axiom**, which asserts the equality of elements related in the setoid. Because `Quotient` is built on a lower-level type `Quot`, `Quotient.sound` is implemented as a theorem. It is derived from `Quot.sound`, the soundness axiom for the lower-level quotient type `Quot`.
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
lift {α : Sort u} {β : Sort v} {s : Setoid α} (f : α → β) : ((a b : α) → a ≈ b → f a = f b) → Quotient s → β
Quot.lift f
abbrev
Quotient.lift
Init
src/Init/Core.lean
[]
[ "Quotient", "Setoid" ]
Lifts a function from an underlying type to a function on a quotient, requiring that it respects the quotient's equivalence relation. Given `s : Setoid α` and a quotient `Quotient s`, applying a function `f : α → β` requires a proof `h` that `f` respects the equivalence relation `s.r`. In this case, the function `Quot...
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
ind {α : Sort u} {s : Setoid α} {motive : Quotient s → Prop} : ((a : α) → motive (Quotient.mk s a)) → (q : Quotient s) → motive q
Quot.ind
theorem
Quotient.ind
Init
src/Init/Core.lean
[]
[ "Quotient", "Quotient.mk", "Setoid" ]
A reasoning principle for quotients that allows proofs about quotients to assume that all values are constructed with `Quotient.mk`.
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
liftOn {α : Sort u} {β : Sort v} {s : Setoid α} (q : Quotient s) (f : α → β) (c : (a b : α) → a ≈ b → f a = f b) : β
Quot.liftOn q f c
abbrev
Quotient.liftOn
Init
src/Init/Core.lean
[]
[ "Quot.liftOn", "Quotient", "Setoid" ]
Lifts a function from an underlying type to a function on a quotient, requiring that it respects the quotient's equivalence relation. Given `s : Setoid α` and a quotient value `q : Quotient s`, applying a function `f : α → β` requires a proof `c` that `f` respects the equivalence relation `s.r`. In this case, the term...
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
inductionOn {α : Sort u} {s : Setoid α} {motive : Quotient s → Prop} (q : Quotient s) (h : (a : α) → motive (Quotient.mk s a)) : motive q
Quot.inductionOn q h
theorem
Quotient.inductionOn
Init
src/Init/Core.lean
[]
[ "Quot.inductionOn", "Quotient", "Quotient.mk", "Setoid" ]
The analogue of `Quot.inductionOn`: every element of `Quotient s` is of the form `Quotient.mk s a`.
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
exists_rep {α : Sort u} {s : Setoid α} (q : Quotient s) : Exists (fun (a : α) => Quotient.mk s a = q)
Quot.exists_rep q
theorem
Quotient.exists_rep
Init
src/Init/Core.lean
[]
[ "Exists", "Quot.exists_rep", "Quotient", "Quotient.mk", "Setoid" ]
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
rec (f : (a : α) → motive (Quotient.mk s a)) (h : (a b : α) → (p : a ≈ b) → Eq.ndrec (f a) (Quotient.sound p) = f b) (q : Quotient s) : motive q
Quot.rec f h q
def
Quotient.rec
Init
src/Init/Core.lean
[]
[ "Quot.rec", "Quotient", "Quotient.mk", "Quotient.sound" ]
A dependent recursion principle for `Quotient`. It is analogous to the [recursor](lean-manual://section/recursors) for a structure, and can be used when the resulting type is not necessarily a proposition. While it is very general, this recursor can be tricky to use. The following simpler alternatives may be easier to...
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
recOn (q : Quotient s) (f : (a : α) → motive (Quotient.mk s a)) (h : (a b : α) → (p : a ≈ b) → Eq.ndrec (f a) (Quotient.sound p) = f b) : motive q
Quot.recOn q f h
abbrev
Quotient.recOn
Init
src/Init/Core.lean
[]
[ "Quot.recOn", "Quotient", "Quotient.mk", "Quotient.sound" ]
A dependent recursion principle for `Quotient`. It is analogous to the [recursor](lean-manual://section/recursors) for a structure, and can be used when the resulting type is not necessarily a proposition. While it is very general, this recursor can be tricky to use. The following simpler alternatives may be easier to...
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
recOnSubsingleton [h : (a : α) → Subsingleton (motive (Quotient.mk s a))] (q : Quotient s) (f : (a : α) → motive (Quotient.mk s a)) : motive q
Quot.recOnSubsingleton (h := h) q f
abbrev
Quotient.recOnSubsingleton
Init
src/Init/Core.lean
[]
[ "Quot.recOnSubsingleton", "Quotient", "Quotient.mk", "Subsingleton" ]
An alternative recursion or induction principle for quotients that can be used when the target type is a subsingleton, in which all elements are equal. In these cases, the proof that the function respects the quotient's equivalence relation is trivial, so any function can be lifted. `Quotient.rec` does not assume tha...
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
hrecOn (q : Quotient s) (f : (a : α) → motive (Quotient.mk s a)) (c : (a b : α) → (p : a ≈ b) → f a ≍ f b) : motive q
Quot.hrecOn q f c
abbrev
Quotient.hrecOn
Init
src/Init/Core.lean
[]
[ "Quot.hrecOn", "Quotient", "Quotient.mk" ]
A dependent recursion principle for `Quotient` that uses [heterogeneous equality](lean-manual://section/HEq), analogous to a [recursor](lean-manual://section/recursors) for a structure. `Quotient.recOn` is a version of this recursor that uses `Eq` instead of `HEq`.
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
lift₂ (f : α → β → φ) (c : (a₁ : α) → (b₁ : β) → (a₂ : α) → (b₂ : β) → a₁ ≈ a₂ → b₁ ≈ b₂ → f a₁ b₁ = f a₂ b₂) (q₁ : Quotient s₁) (q₂ : Quotient s₂) : φ
by apply Quotient.lift (fun (a₁ : α) => Quotient.lift (f a₁) (fun (a b : β) => c a₁ a a₁ b (Setoid.refl a₁)) q₂) _ q₁ intros induction q₂ using Quotient.ind apply c; assumption; apply Setoid.refl
abbrev
Quotient.lift₂
Init
src/Init/Core.lean
[]
[ "Quotient", "Quotient.ind", "Quotient.lift", "Setoid.refl" ]
Lifts a binary function from the underlying types to a binary function on quotients. The function must respect both quotients' equivalence relations. `Quotient.lift` is a version of this operation for unary functions. `Quotient.liftOn₂` is a version that take the quotient parameters first.
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
liftOn₂ (q₁ : Quotient s₁) (q₂ : Quotient s₂) (f : α → β → φ) (c : (a₁ : α) → (b₁ : β) → (a₂ : α) → (b₂ : β) → a₁ ≈ a₂ → b₁ ≈ b₂ → f a₁ b₁ = f a₂ b₂) : φ
Quotient.lift₂ f c q₁ q₂
abbrev
Quotient.liftOn₂
Init
src/Init/Core.lean
[]
[ "Quotient", "Quotient.lift₂" ]
Lifts a binary function from the underlying types to a binary function on quotients. The function must respect both quotients' equivalence relations. `Quotient.liftOn` is a version of this operation for unary functions. `Quotient.lift₂` is a version that take the quotient parameters last.
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
ind₂ {motive : Quotient s₁ → Quotient s₂ → Prop} (h : (a : α) → (b : β) → motive (Quotient.mk s₁ a) (Quotient.mk s₂ b)) (q₁ : Quotient s₁) (q₂ : Quotient s₂) : motive q₁ q₂
by induction q₁ using Quotient.ind induction q₂ using Quotient.ind apply h
theorem
Quotient.ind₂
Init
src/Init/Core.lean
[]
[ "Quotient", "Quotient.ind", "Quotient.mk" ]
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
inductionOn₂ {motive : Quotient s₁ → Quotient s₂ → Prop} (q₁ : Quotient s₁) (q₂ : Quotient s₂) (h : (a : α) → (b : β) → motive (Quotient.mk s₁ a) (Quotient.mk s₂ b)) : motive q₁ q₂
by induction q₁ using Quotient.ind induction q₂ using Quotient.ind apply h
theorem
Quotient.inductionOn₂
Init
src/Init/Core.lean
[]
[ "Quotient", "Quotient.ind", "Quotient.mk" ]
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
inductionOn₃ {s₃ : Setoid φ} {motive : Quotient s₁ → Quotient s₂ → Quotient s₃ → Prop} (q₁ : Quotient s₁) (q₂ : Quotient s₂) (q₃ : Quotient s₃) (h : (a : α) → (b : β) → (c : φ) → motive (Quotient.mk s₁ a) (Quotient.mk s₂ b) (Quotient.mk s₃ c)) : motive q₁ q₂ q₃
by induction q₁ using Quotient.ind induction q₂ using Quotient.ind induction q₃ using Quotient.ind apply h
theorem
Quotient.inductionOn₃
Init
src/Init/Core.lean
[]
[ "Quotient", "Quotient.ind", "Quotient.mk", "Setoid" ]
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
rel {s : Setoid α} (q₁ q₂ : Quotient s) : Prop
Quotient.liftOn₂ q₁ q₂ (fun a₁ a₂ => a₁ ≈ a₂) (fun _ _ _ _ a₁b₁ a₂b₂ => propext (Iff.intro (fun a₁a₂ => Setoid.trans (Setoid.symm a₁b₁) (Setoid.trans a₁a₂ a₂b₂)) (fun b₁b₂ => Setoid.trans a₁b₁ (Setoid.trans b₁b₂ (Setoid.symm a₂b₂)))))
def
Quotient.rel
Init
src/Init/Core.lean
[]
[ "Quotient", "Quotient.liftOn₂", "Setoid", "Setoid.symm", "Setoid.trans", "propext" ]
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
rel.refl {s : Setoid α} (q : Quotient s) : rel q q
q.inductionOn Setoid.refl
theorem
Quotient.rel.refl
Init
src/Init/Core.lean
[]
[ "Quotient", "Setoid", "Setoid.refl" ]
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
rel_of_eq {s : Setoid α} {q₁ q₂ : Quotient s} : q₁ = q₂ → rel q₁ q₂
fun h => Eq.ndrecOn h (rel.refl q₁)
theorem
Quotient.rel_of_eq
Init
src/Init/Core.lean
[]
[ "Quotient", "Setoid" ]
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
exact {s : Setoid α} {a b : α} : Quotient.mk s a = Quotient.mk s b → a ≈ b
fun h => rel_of_eq h
theorem
Quotient.exact
Init
src/Init/Core.lean
[]
[ "Quotient.mk", "Setoid" ]
If two values are equal in a quotient, then they are related by its equivalence relation.
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
recOnSubsingleton₂ {motive : Quotient s₁ → Quotient s₂ → Sort uC} [s : (a : α) → (b : β) → Subsingleton (motive (Quotient.mk s₁ a) (Quotient.mk s₂ b))] (q₁ : Quotient s₁) (q₂ : Quotient s₂) (g : (a : α) → (b : β) → motive (Quotient.mk s₁ a) (Quotient.mk s₂ b)) : motive q₁ q₂
by induction q₁ using Quot.recOnSubsingleton induction q₂ using Quot.recOnSubsingleton apply g intro a; apply s induction q₂ using Quot.recOnSubsingleton intro a; apply s infer_instance
abbrev
Quotient.recOnSubsingleton₂
Init
src/Init/Core.lean
[]
[ "Quot.recOnSubsingleton", "Quotient", "Quotient.mk", "Subsingleton" ]
An alternative induction or recursion operator for defining binary operations on quotients that can be used when the target type is a subsingleton. In these cases, the proof that the function respects the quotient's equivalence relation is trivial, so any function can be lifted.
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
Quotient.decidableEq {α : Sort u} {s : Setoid α} [d : ∀ (a b : α), Decidable (a ≈ b)] : DecidableEq (Quotient s)
fun (q₁ q₂ : Quotient s) => Quotient.recOnSubsingleton₂ q₁ q₂ fun a₁ a₂ => match d a₁ a₂ with | isTrue h₁ => isTrue (Quotient.sound h₁) | isFalse h₂ => isFalse fun h => absurd (Quotient.exact h) h₂
instance
Quotient.decidableEq
Init
src/Init/Core.lean
[]
[ "Decidable", "DecidableEq", "Quotient", "Quotient.exact", "Quotient.recOnSubsingleton₂", "Quotient.sound", "Setoid", "absurd" ]
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
funext {α : Sort u} {β : α → Sort v} {f g : (x : α) → β x} (h : ∀ x, f x = g x) : f = g
by let eqv (f g : (x : α) → β x) := ∀ x, f x = g x let extfunApp (f : Quot eqv) (x : α) : β x := Quot.liftOn f (fun (f : ∀ (x : α), β x) => f x) (fun _ _ h => h x) change extfunApp (Quot.mk eqv f) = extfunApp (Quot.mk eqv g) exact congrArg extfunApp (Quot.sound h)
theorem
funext
Init
src/Init/Core.lean
[]
[ "Quot.liftOn", "Quot.sound", "congrArg" ]
**Function extensionality.** If two functions return equal results for all possible arguments, then they are equal. It is called “extensionality” because it provides a way to prove two objects equal based on the properties of the underlying mathematical functions, rather than based on the syntax used to denote them. F...
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
Quot.pliftOn {α : Sort u} {r : α → α → Prop} (q : Quot r) (f : (a : α) → q = Quot.mk r a → β) (h : ∀ (a b : α) (h h'), r a b → f a h = f b h') : β
q.rec (motive := fun q' => q = q' → β) f (fun a b p => funext fun h' => (apply_eqRec (motive := fun b _ => q = b)).trans (@h a b (h'.trans (sound p).symm) h' p)) rfl
abbrev
Quot.pliftOn
Init
src/Init/Core.lean
[]
[ "apply_eqRec", "funext", "rfl" ]
Like `Quot.liftOn q f h` but allows `f a` to "know" that `q = Quot.mk r a`.
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
Quotient.pliftOn {α : Sort u} {s : Setoid α} (q : Quotient s) (f : (a : α) → q = Quotient.mk s a → β) (h : ∀ (a b : α) (h h'), a ≈ b → f a h = f b h') : β
Quot.pliftOn q f h
abbrev
Quotient.pliftOn
Init
src/Init/Core.lean
[]
[ "Quot.pliftOn", "Quotient", "Quotient.mk", "Setoid" ]
Like `Quotient.liftOn q f h` but allows `f a` to "know" that `q = Quotient.mk s a`.
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
Pi.instSubsingleton {α : Sort u} {β : α → Sort v} [∀ a, Subsingleton (β a)] : Subsingleton (∀ a, β a)
where allEq f g := funext fun a => Subsingleton.elim (f a) (g a)
instance
Pi.instSubsingleton
Init
src/Init/Core.lean
[]
[ "Subsingleton", "Subsingleton.elim", "funext" ]
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
equivalence_true (α : Sort u) : Equivalence fun _ _ : α => True
⟨fun _ => trivial, fun _ => trivial, fun _ _ => trivial⟩
theorem
equivalence_true
Init
src/Init/Core.lean
[]
[ "Equivalence", "True", "trivial" ]
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
Setoid.trivial (α : Sort u) : Setoid α
⟨_, equivalence_true α⟩
def
Setoid.trivial
Init
src/Init/Core.lean
[]
[ "Setoid", "equivalence_true" ]
Always-true relation as a `Setoid`.
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
Squash (α : Sort u)
Quotient (Setoid.trivial α)
def
Squash
Init
src/Init/Core.lean
[]
[ "Quotient", "Setoid.trivial" ]
The quotient of `α` by the universal relation. The elements of `Squash α` are those of `α`, but all of them are equal and cannot be distinguished. `Squash α` is a `Subsingleton`: it is empty if `α` is empty, otherwise it has just one element. It is the “universal `Subsingleton`” mapped from `α`. `Nonempty α` also has...
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
Squash.mk {α : Sort u} (x : α) : Squash α
Quot.mk _ x
def
Squash.mk
Init
src/Init/Core.lean
[]
[ "Squash" ]
Places a value into its squash type, in which it cannot be distinguished from any other.
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
Squash.ind {α : Sort u} {motive : Squash α → Prop} (h : ∀ (a : α), motive (Squash.mk a)) : ∀ (q : Squash α), motive q
Quot.ind h
theorem
Squash.ind
Init
src/Init/Core.lean
[]
[ "Squash", "Squash.mk" ]
A reasoning principle that allows proofs about squashed types to assume that all values are constructed with `Squash.mk`.
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
Squash.lift {α β} [Subsingleton β] (s : Squash α) (f : α → β) : β
Quot.lift f (fun _ _ _ => Subsingleton.elim _ _) s
def
Squash.lift
Init
src/Init/Core.lean
[]
[ "Squash", "Subsingleton", "Subsingleton.elim" ]
Extracts a squashed value into any subsingleton type. If `β` is a subsingleton, a function `α → β` cannot distinguish between elements of `α` and thus automatically respects the universal relation that `Squash` quotients with.
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
trustCompiler : True
axiom
Lean.trustCompiler
Init
src/Init/Core.lean
[]
[ "True" ]
Depends on the correctness of the Lean compiler, interpreter, and all `[implemented_by ...]` and `[extern ...]` annotations.
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
reduceBool (b : Bool) : Bool
-- This ensures that `#print axioms` will track use of `reduceBool`. have := trustCompiler b
opaque
Lean.reduceBool
Init
src/Init/Core.lean
[]
[ "Bool" ]
When the kernel tries to reduce a term `Lean.reduceBool c`, it will invoke the Lean interpreter to evaluate `c`. The kernel will not use the interpreter if `c` is not a constant. This feature is useful for performing proofs by reflection. Remark: the Lean frontend allows terms of the from `Lean.reduceBool t` where `t`...
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
reduceNat (n : Nat) : Nat
-- This ensures that `#print axioms` will track use of `reduceNat`. have := trustCompiler n
opaque
Lean.reduceNat
Init
src/Init/Core.lean
[]
[ "Nat" ]
Similar to `Lean.reduceBool` for closed `Nat` terms. Remark: we do not have plans for supporting a generic `reduceValue {α} (a : α) : α := a`. The main issue is that it is non-trivial to convert an arbitrary runtime object back into a Lean expression. We believe `Lean.reduceBool` enables most interesting applications ...
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
ofReduceBool (a b : Bool) (h : reduceBool a = b) : a = b
axiom
Lean.ofReduceBool
Init
src/Init/Core.lean
[]
[ "Bool" ]
The axiom `ofReduceBool` is used to perform proofs by reflection. See `reduceBool`. This axiom is usually not used directly, because it has some syntactic restrictions. Instead, the `native_decide` tactic can be used to prove any proposition whose decidability instance can be evaluated to `true` using the lean compile...
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
ofReduceNat (a b : Nat) (h : reduceNat a = b) : a = b
axiom
Lean.ofReduceNat
Init
src/Init/Core.lean
[]
[ "Nat" ]
The axiom `ofReduceNat` is used to perform proofs by reflection. See `reduceBool`. Warning: by using this feature, the Lean compiler and interpreter become part of your trusted code base. This is extra 30k lines of code. More importantly, you will probably not be able to check your development using external type chec...
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
opaqueId {α : Sort u} (x : α) : α
x
opaque
Lean.opaqueId
Init
src/Init/Core.lean
[]
[]
The term `opaqueId x` will not be reduced by the kernel.
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
ge_iff_le [LE α] {x y : α} : x ≥ y ↔ y ≤ x
Iff.rfl
theorem
ge_iff_le
Init
src/Init/Core.lean
[]
[ "Iff.rfl", "LE" ]
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
gt_iff_lt [LT α] {x y : α} : x > y ↔ y < x
Iff.rfl
theorem
gt_iff_lt
Init
src/Init/Core.lean
[]
[ "Iff.rfl", "LT" ]
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
le_of_eq_of_le {a b c : α} [LE α] (h₁ : a = b) (h₂ : b ≤ c) : a ≤ c
h₁ ▸ h₂
theorem
le_of_eq_of_le
Init
src/Init/Core.lean
[]
[ "LE" ]
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
le_of_le_of_eq {a b c : α} [LE α] (h₁ : a ≤ b) (h₂ : b = c) : a ≤ c
h₂ ▸ h₁
theorem
le_of_le_of_eq
Init
src/Init/Core.lean
[]
[ "LE" ]
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6
lt_of_eq_of_lt {a b c : α} [LT α] (h₁ : a = b) (h₂ : b < c) : a < c
h₁ ▸ h₂
theorem
lt_of_eq_of_lt
Init
src/Init/Core.lean
[]
[ "LT" ]
https://github.com/leanprover/lean4
d265d1ca745e7741a7e7f7366c22ce9c9dda57b6