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
comp_id (f : α →. β) : f.comp (PFun.id α) = f := ext fun _ _ => by simp @[simp]
theorem
Data
[ "Batteries.WF", "Mathlib.Data.Part", "Mathlib.Data.Rel", "Mathlib.Tactic.GeneralizeProofs" ]
Mathlib/Data/PFun.lean
comp_id
null
dom_comp (f : β →. γ) (g : α →. β) : (f.comp g).Dom = g.preimage f.Dom := by ext simp_rw [mem_preimage, mem_dom, comp_apply, Part.mem_bind_iff, ← exists_and_right] rw [exists_comm] simp_rw [and_comm] @[simp]
theorem
Data
[ "Batteries.WF", "Mathlib.Data.Part", "Mathlib.Data.Rel", "Mathlib.Tactic.GeneralizeProofs" ]
Mathlib/Data/PFun.lean
dom_comp
null
preimage_comp (f : β →. γ) (g : α →. β) (s : Set γ) : (f.comp g).preimage s = g.preimage (f.preimage s) := by ext simp_rw [mem_preimage, comp_apply, Part.mem_bind_iff, ← exists_and_right, ← exists_and_left] rw [exists_comm] simp_rw [and_assoc, and_comm] @[simp]
theorem
Data
[ "Batteries.WF", "Mathlib.Data.Part", "Mathlib.Data.Rel", "Mathlib.Tactic.GeneralizeProofs" ]
Mathlib/Data/PFun.lean
preimage_comp
null
Part.bind_comp (f : β →. γ) (g : α →. β) (a : Part α) : a.bind (f.comp g) = (a.bind g).bind f := by ext c simp_rw [Part.mem_bind_iff, comp_apply, Part.mem_bind_iff, ← exists_and_right, ← exists_and_left] rw [exists_comm] simp_rw [and_assoc] @[simp]
theorem
Data
[ "Batteries.WF", "Mathlib.Data.Part", "Mathlib.Data.Rel", "Mathlib.Tactic.GeneralizeProofs" ]
Mathlib/Data/PFun.lean
Part.bind_comp
null
comp_assoc (f : γ →. δ) (g : β →. γ) (h : α →. β) : (f.comp g).comp h = f.comp (g.comp h) := ext fun _ _ => by simp only [comp_apply, Part.bind_comp]
theorem
Data
[ "Batteries.WF", "Mathlib.Data.Part", "Mathlib.Data.Rel", "Mathlib.Tactic.GeneralizeProofs" ]
Mathlib/Data/PFun.lean
comp_assoc
null
coe_comp (g : β → γ) (f : α → β) : ((g ∘ f : α → γ) : α →. γ) = (g : β →. γ).comp f := ext fun _ _ => by simp only [coe_val, comp_apply, Function.comp, Part.bind_some]
theorem
Data
[ "Batteries.WF", "Mathlib.Data.Part", "Mathlib.Data.Rel", "Mathlib.Tactic.GeneralizeProofs" ]
Mathlib/Data/PFun.lean
coe_comp
null
prodLift (f : α →. β) (g : α →. γ) : α →. β × γ := fun x => ⟨(f x).Dom ∧ (g x).Dom, fun h => ((f x).get h.1, (g x).get h.2)⟩ @[simp]
def
Data
[ "Batteries.WF", "Mathlib.Data.Part", "Mathlib.Data.Rel", "Mathlib.Tactic.GeneralizeProofs" ]
Mathlib/Data/PFun.lean
prodLift
Product of partial functions.
dom_prodLift (f : α →. β) (g : α →. γ) : (f.prodLift g).Dom = { x | (f x).Dom ∧ (g x).Dom } := rfl
theorem
Data
[ "Batteries.WF", "Mathlib.Data.Part", "Mathlib.Data.Rel", "Mathlib.Tactic.GeneralizeProofs" ]
Mathlib/Data/PFun.lean
dom_prodLift
null
get_prodLift (f : α →. β) (g : α →. γ) (x : α) (h) : (f.prodLift g x).get h = ((f x).get h.1, (g x).get h.2) := rfl @[simp]
theorem
Data
[ "Batteries.WF", "Mathlib.Data.Part", "Mathlib.Data.Rel", "Mathlib.Tactic.GeneralizeProofs" ]
Mathlib/Data/PFun.lean
get_prodLift
null
prodLift_apply (f : α →. β) (g : α →. γ) (x : α) : f.prodLift g x = ⟨(f x).Dom ∧ (g x).Dom, fun h => ((f x).get h.1, (g x).get h.2)⟩ := rfl
theorem
Data
[ "Batteries.WF", "Mathlib.Data.Part", "Mathlib.Data.Rel", "Mathlib.Tactic.GeneralizeProofs" ]
Mathlib/Data/PFun.lean
prodLift_apply
null
mem_prodLift {f : α →. β} {g : α →. γ} {x : α} {y : β × γ} : y ∈ f.prodLift g x ↔ y.1 ∈ f x ∧ y.2 ∈ g x := by trans ∃ hp hq, (f x).get hp = y.1 ∧ (g x).get hq = y.2 · simp only [prodLift, Part.mem_mk_iff, And.exists, Prod.ext_iff] · simp only [exists_and_left, exists_and_right, Membership.mem, Part.Mem]
theorem
Data
[ "Batteries.WF", "Mathlib.Data.Part", "Mathlib.Data.Rel", "Mathlib.Tactic.GeneralizeProofs" ]
Mathlib/Data/PFun.lean
mem_prodLift
null
prodMap (f : α →. γ) (g : β →. δ) : α × β →. γ × δ := fun x => ⟨(f x.1).Dom ∧ (g x.2).Dom, fun h => ((f x.1).get h.1, (g x.2).get h.2)⟩ @[simp]
def
Data
[ "Batteries.WF", "Mathlib.Data.Part", "Mathlib.Data.Rel", "Mathlib.Tactic.GeneralizeProofs" ]
Mathlib/Data/PFun.lean
prodMap
Product of partial functions.
dom_prodMap (f : α →. γ) (g : β →. δ) : (f.prodMap g).Dom = { x | (f x.1).Dom ∧ (g x.2).Dom } := rfl
theorem
Data
[ "Batteries.WF", "Mathlib.Data.Part", "Mathlib.Data.Rel", "Mathlib.Tactic.GeneralizeProofs" ]
Mathlib/Data/PFun.lean
dom_prodMap
null
get_prodMap (f : α →. γ) (g : β →. δ) (x : α × β) (h) : (f.prodMap g x).get h = ((f x.1).get h.1, (g x.2).get h.2) := rfl @[simp]
theorem
Data
[ "Batteries.WF", "Mathlib.Data.Part", "Mathlib.Data.Rel", "Mathlib.Tactic.GeneralizeProofs" ]
Mathlib/Data/PFun.lean
get_prodMap
null
prodMap_apply (f : α →. γ) (g : β →. δ) (x : α × β) : f.prodMap g x = ⟨(f x.1).Dom ∧ (g x.2).Dom, fun h => ((f x.1).get h.1, (g x.2).get h.2)⟩ := rfl
theorem
Data
[ "Batteries.WF", "Mathlib.Data.Part", "Mathlib.Data.Rel", "Mathlib.Tactic.GeneralizeProofs" ]
Mathlib/Data/PFun.lean
prodMap_apply
null
mem_prodMap {f : α →. γ} {g : β →. δ} {x : α × β} {y : γ × δ} : y ∈ f.prodMap g x ↔ y.1 ∈ f x.1 ∧ y.2 ∈ g x.2 := by trans ∃ hp hq, (f x.1).get hp = y.1 ∧ (g x.2).get hq = y.2 · simp only [prodMap, Part.mem_mk_iff, And.exists, Prod.ext_iff] · simp only [exists_and_left, exists_and_right, Membership.mem, Part.Mem] @[simp]
theorem
Data
[ "Batteries.WF", "Mathlib.Data.Part", "Mathlib.Data.Rel", "Mathlib.Tactic.GeneralizeProofs" ]
Mathlib/Data/PFun.lean
mem_prodMap
null
prodLift_fst_comp_snd_comp (f : α →. γ) (g : β →. δ) : prodLift (f.comp ((Prod.fst : α × β → α) : α × β →. α)) (g.comp ((Prod.snd : α × β → β) : α × β →. β)) = prodMap f g := by aesop @[simp]
theorem
Data
[ "Batteries.WF", "Mathlib.Data.Part", "Mathlib.Data.Rel", "Mathlib.Tactic.GeneralizeProofs" ]
Mathlib/Data/PFun.lean
prodLift_fst_comp_snd_comp
null
prodMap_id_id : (PFun.id α).prodMap (PFun.id β) = PFun.id _ := by aesop @[simp]
theorem
Data
[ "Batteries.WF", "Mathlib.Data.Part", "Mathlib.Data.Rel", "Mathlib.Tactic.GeneralizeProofs" ]
Mathlib/Data/PFun.lean
prodMap_id_id
null
prodMap_comp_comp (f₁ : α →. β) (f₂ : β →. γ) (g₁ : δ →. ε) (g₂ : ε →. ι) : (f₂.comp f₁).prodMap (g₂.comp g₁) = (f₂.prodMap g₂).comp (f₁.prodMap g₁) := ext <| fun ⟨_, _⟩ ⟨_, _⟩ ↦ ⟨fun ⟨⟨⟨h1l1, h1l2⟩, ⟨h1r1, h1r2⟩⟩, h2⟩ ↦ ⟨⟨⟨h1l1, h1r1⟩, ⟨h1l2, h1r2⟩⟩, h2⟩, fun ⟨⟨⟨h1l1, h1r1⟩, ⟨h1l2, h1r2⟩⟩, h2⟩ ↦ ⟨⟨⟨h1l1, h1l2⟩, ⟨h1r1, h1r2⟩⟩, h2⟩⟩
theorem
Data
[ "Batteries.WF", "Mathlib.Data.Part", "Mathlib.Data.Rel", "Mathlib.Tactic.GeneralizeProofs" ]
Mathlib/Data/PFun.lean
prodMap_comp_comp
null
protected hrecOn₂ (qa : Quot ra) (qb : Quot rb) (f : ∀ a b, φ ⟦a⟧ ⟦b⟧) (ca : ∀ {b a₁ a₂}, ra a₁ a₂ → f a₁ b ≍ f a₂ b) (cb : ∀ {a b₁ b₂}, rb b₁ b₂ → f a b₁ ≍ f a b₂) : φ qa qb := Quot.hrecOn (motive := fun qa ↦ φ qa qb) qa (fun a ↦ Quot.hrecOn qb (f a) (fun _ _ pb ↦ cb pb)) fun a₁ a₂ pa ↦ Quot.induction_on qb fun b ↦ have h₁ : @Quot.hrecOn _ _ (φ _) ⟦b⟧ (f a₁) (@cb _) ≍ f a₁ b := by simp have h₂ : f a₂ b ≍ @Quot.hrecOn _ _ (φ _) ⟦b⟧ (f a₂) (@cb _) := by simp (h₁.trans (ca pa)).trans h₂
def
Data
[ "Mathlib.Logic.Relation", "Mathlib.Logic.Unique", "Mathlib.Util.Notation3" ]
Mathlib/Data/Quot.lean
hrecOn₂
When writing a lemma about `someSetoid x y` (which uses this instance), call it `someSetoid_apply` not `someSetoid_r`. -/ instance : CoeFun (Setoid α) (fun _ ↦ α → α → Prop) where coe := @Setoid.r _ theorem ext {α : Sort*} : ∀ {s t : Setoid α}, (∀ a b, s a b ↔ t a b) → s = t | ⟨r, _⟩, ⟨p, _⟩, Eq => by have : r = p := funext fun a ↦ funext fun b ↦ propext <| Eq a b subst this rfl end Setoid namespace Quot variable {ra : α → α → Prop} {rb : β → β → Prop} {φ : Quot ra → Quot rb → Sort*} @[inherit_doc Quot.mk] local notation3:arg "⟦" a "⟧" => Quot.mk _ a @[elab_as_elim] protected theorem induction_on {α : Sort*} {r : α → α → Prop} {β : Quot r → Prop} (q : Quot r) (h : ∀ a, β (Quot.mk r a)) : β q := ind h q instance (r : α → α → Prop) [Inhabited α] : Inhabited (Quot r) := ⟨⟦default⟧⟩ protected instance Subsingleton [Subsingleton α] : Subsingleton (Quot ra) := ⟨fun x ↦ Quot.induction_on x fun _ ↦ Quot.ind fun _ ↦ congr_arg _ (Subsingleton.elim _ _)⟩ instance [Unique α] : Unique (Quot ra) := Unique.mk' _ /-- Recursion on two `Quotient` arguments `a` and `b`, result type depends on `⟦a⟧` and `⟦b⟧`.
protected map (f : α → β) (h : ∀ ⦃a b : α⦄, ra a b → rb (f a) (f b)) : Quot ra → Quot rb := Quot.lift (fun x => Quot.mk rb (f x)) fun _ _ hra ↦ Quot.sound <| h hra
def
Data
[ "Mathlib.Logic.Relation", "Mathlib.Logic.Unique", "Mathlib.Util.Notation3" ]
Mathlib/Data/Quot.lean
map
Map a function `f : α → β` such that `ra x y` implies `rb (f x) (f y)` to a map `Quot ra → Quot rb`.
protected mapRight {ra' : α → α → Prop} (h : ∀ a₁ a₂, ra a₁ a₂ → ra' a₁ a₂) : Quot ra → Quot ra' := Quot.map id h
def
Data
[ "Mathlib.Logic.Relation", "Mathlib.Logic.Unique", "Mathlib.Util.Notation3" ]
Mathlib/Data/Quot.lean
mapRight
If `ra` is a subrelation of `ra'`, then we have a natural map `Quot ra → Quot ra'`.
factor {α : Type*} (r s : α → α → Prop) (h : ∀ x y, r x y → s x y) : Quot r → Quot s := Quot.lift (Quot.mk s) fun x y rxy ↦ Quot.sound (h x y rxy)
def
Data
[ "Mathlib.Logic.Relation", "Mathlib.Logic.Unique", "Mathlib.Util.Notation3" ]
Mathlib/Data/Quot.lean
factor
Weaken the relation of a quotient. This is the same as `Quot.map id`.
factor_mk_eq {α : Type*} (r s : α → α → Prop) (h : ∀ x y, r x y → s x y) : factor r s h ∘ Quot.mk _ = Quot.mk _ := rfl variable {γ : Sort*} {r : α → α → Prop} {s : β → β → Prop}
theorem
Data
[ "Mathlib.Logic.Relation", "Mathlib.Logic.Unique", "Mathlib.Util.Notation3" ]
Mathlib/Data/Quot.lean
factor_mk_eq
null
lift_mk (f : α → γ) (h : ∀ a₁ a₂, r a₁ a₂ → f a₁ = f a₂) (a : α) : Quot.lift f h (Quot.mk r a) = f a := rfl
theorem
Data
[ "Mathlib.Logic.Relation", "Mathlib.Logic.Unique", "Mathlib.Util.Notation3" ]
Mathlib/Data/Quot.lean
lift_mk
null
liftOn_mk (a : α) (f : α → γ) (h : ∀ a₁ a₂, r a₁ a₂ → f a₁ = f a₂) : Quot.liftOn (Quot.mk r a) f h = f a := rfl @[simp] theorem surjective_lift {f : α → γ} (h : ∀ a₁ a₂, r a₁ a₂ → f a₁ = f a₂) : Function.Surjective (lift f h) ↔ Function.Surjective f := ⟨fun hf => hf.comp Quot.exists_rep, fun hf y => let ⟨x, hx⟩ := hf y; ⟨Quot.mk _ x, hx⟩⟩
theorem
Data
[ "Mathlib.Logic.Relation", "Mathlib.Logic.Unique", "Mathlib.Util.Notation3" ]
Mathlib/Data/Quot.lean
liftOn_mk
null
protected lift₂ (f : α → β → γ) (hr : ∀ a b₁ b₂, s b₁ b₂ → f a b₁ = f a b₂) (hs : ∀ a₁ a₂ b, r a₁ a₂ → f a₁ b = f a₂ b) (q₁ : Quot r) (q₂ : Quot s) : γ := Quot.lift (fun a ↦ Quot.lift (f a) (hr a)) (fun a₁ a₂ ha ↦ funext fun q ↦ Quot.induction_on q fun b ↦ hs a₁ a₂ b ha) q₁ q₂ @[simp]
def
Data
[ "Mathlib.Logic.Relation", "Mathlib.Logic.Unique", "Mathlib.Util.Notation3" ]
Mathlib/Data/Quot.lean
lift₂
Descends a function `f : α → β → γ` to quotients of `α` and `β`.
lift₂_mk (f : α → β → γ) (hr : ∀ a b₁ b₂, s b₁ b₂ → f a b₁ = f a b₂) (hs : ∀ a₁ a₂ b, r a₁ a₂ → f a₁ b = f a₂ b) (a : α) (b : β) : Quot.lift₂ f hr hs (Quot.mk r a) (Quot.mk s b) = f a b := rfl
theorem
Data
[ "Mathlib.Logic.Relation", "Mathlib.Logic.Unique", "Mathlib.Util.Notation3" ]
Mathlib/Data/Quot.lean
lift₂_mk
null
protected liftOn₂ (p : Quot r) (q : Quot s) (f : α → β → γ) (hr : ∀ a b₁ b₂, s b₁ b₂ → f a b₁ = f a b₂) (hs : ∀ a₁ a₂ b, r a₁ a₂ → f a₁ b = f a₂ b) : γ := Quot.lift₂ f hr hs p q @[simp]
def
Data
[ "Mathlib.Logic.Relation", "Mathlib.Logic.Unique", "Mathlib.Util.Notation3" ]
Mathlib/Data/Quot.lean
liftOn₂
Descends a function `f : α → β → γ` to quotients of `α` and `β` and applies it.
liftOn₂_mk (a : α) (b : β) (f : α → β → γ) (hr : ∀ a b₁ b₂, s b₁ b₂ → f a b₁ = f a b₂) (hs : ∀ a₁ a₂ b, r a₁ a₂ → f a₁ b = f a₂ b) : Quot.liftOn₂ (Quot.mk r a) (Quot.mk s b) f hr hs = f a b := rfl variable {t : γ → γ → Prop}
theorem
Data
[ "Mathlib.Logic.Relation", "Mathlib.Logic.Unique", "Mathlib.Util.Notation3" ]
Mathlib/Data/Quot.lean
liftOn₂_mk
null
protected map₂ (f : α → β → γ) (hr : ∀ a b₁ b₂, s b₁ b₂ → t (f a b₁) (f a b₂)) (hs : ∀ a₁ a₂ b, r a₁ a₂ → t (f a₁ b) (f a₂ b)) (q₁ : Quot r) (q₂ : Quot s) : Quot t := Quot.lift₂ (fun a b ↦ Quot.mk t <| f a b) (fun a b₁ b₂ hb ↦ Quot.sound (hr a b₁ b₂ hb)) (fun a₁ a₂ b ha ↦ Quot.sound (hs a₁ a₂ b ha)) q₁ q₂ @[simp]
def
Data
[ "Mathlib.Logic.Relation", "Mathlib.Logic.Unique", "Mathlib.Util.Notation3" ]
Mathlib/Data/Quot.lean
map₂
Descends a function `f : α → β → γ` to quotients of `α` and `β` with values in a quotient of `γ`.
map₂_mk (f : α → β → γ) (hr : ∀ a b₁ b₂, s b₁ b₂ → t (f a b₁) (f a b₂)) (hs : ∀ a₁ a₂ b, r a₁ a₂ → t (f a₁ b) (f a₂ b)) (a : α) (b : β) : Quot.map₂ f hr hs (Quot.mk r a) (Quot.mk s b) = Quot.mk t (f a b) := rfl
theorem
Data
[ "Mathlib.Logic.Relation", "Mathlib.Logic.Unique", "Mathlib.Util.Notation3" ]
Mathlib/Data/Quot.lean
map₂_mk
null
@[elab_as_elim] protected recOnSubsingleton₂ {φ : Quot r → Quot s → Sort*} [h : ∀ a b, Subsingleton (φ ⟦a⟧ ⟦b⟧)] (q₁ : Quot r) (q₂ : Quot s) (f : ∀ a b, φ ⟦a⟧ ⟦b⟧) : φ q₁ q₂ := @Quot.recOnSubsingleton _ r (fun q ↦ φ q q₂) (fun a ↦ Quot.ind (β := fun b ↦ Subsingleton (φ (mk r a) b)) (h a) q₂) q₁ fun a ↦ Quot.recOnSubsingleton q₂ fun b ↦ f a b @[elab_as_elim]
def
Data
[ "Mathlib.Logic.Relation", "Mathlib.Logic.Unique", "Mathlib.Util.Notation3" ]
Mathlib/Data/Quot.lean
recOnSubsingleton₂
A binary version of `Quot.recOnSubsingleton`.
protected induction_on₂ {δ : Quot r → Quot s → Prop} (q₁ : Quot r) (q₂ : Quot s) (h : ∀ a b, δ (Quot.mk r a) (Quot.mk s b)) : δ q₁ q₂ := Quot.ind (β := fun a ↦ δ a q₂) (fun a₁ ↦ Quot.ind (fun a₂ ↦ h a₁ a₂) q₂) q₁ @[elab_as_elim]
theorem
Data
[ "Mathlib.Logic.Relation", "Mathlib.Logic.Unique", "Mathlib.Util.Notation3" ]
Mathlib/Data/Quot.lean
induction_on₂
null
protected induction_on₃ {δ : Quot r → Quot s → Quot t → Prop} (q₁ : Quot r) (q₂ : Quot s) (q₃ : Quot t) (h : ∀ a b c, δ (Quot.mk r a) (Quot.mk s b) (Quot.mk t c)) : δ q₁ q₂ q₃ := Quot.ind (β := fun a ↦ δ a q₂ q₃) (fun a₁ ↦ Quot.ind (β := fun b ↦ δ _ b q₃) (fun a₂ ↦ Quot.ind (fun a₃ ↦ h a₁ a₂ a₃) q₃) q₂) q₁
theorem
Data
[ "Mathlib.Logic.Relation", "Mathlib.Logic.Unique", "Mathlib.Util.Notation3" ]
Mathlib/Data/Quot.lean
induction_on₃
null
lift.decidablePred (r : α → α → Prop) (f : α → Prop) (h : ∀ a b, r a b → f a = f b) [hf : DecidablePred f] : DecidablePred (Quot.lift f h) := fun q ↦ Quot.recOnSubsingleton (motive := fun _ ↦ Decidable _) q hf
instance
Data
[ "Mathlib.Logic.Relation", "Mathlib.Logic.Unique", "Mathlib.Util.Notation3" ]
Mathlib/Data/Quot.lean
lift.decidablePred
null
lift₂.decidablePred (r : α → α → Prop) (s : β → β → Prop) (f : α → β → Prop) (ha : ∀ a b₁ b₂, s b₁ b₂ → f a b₁ = f a b₂) (hb : ∀ a₁ a₂ b, r a₁ a₂ → f a₁ b = f a₂ b) [hf : ∀ a, DecidablePred (f a)] (q₁ : Quot r) : DecidablePred (Quot.lift₂ f ha hb q₁) := fun q₂ ↦ Quot.recOnSubsingleton₂ q₁ q₂ hf
instance
Data
[ "Mathlib.Logic.Relation", "Mathlib.Logic.Unique", "Mathlib.Util.Notation3" ]
Mathlib/Data/Quot.lean
lift₂.decidablePred
Note that this provides `DecidableRel (Quot.Lift₂ f ha hb)` when `α = β`.
instInhabitedQuotient (s : Setoid α) [Inhabited α] : Inhabited (Quotient s) := ⟨⟦default⟧⟩
instance
Data
[ "Mathlib.Logic.Relation", "Mathlib.Logic.Unique", "Mathlib.Util.Notation3" ]
Mathlib/Data/Quot.lean
instInhabitedQuotient
null
instSubsingletonQuotient (s : Setoid α) [Subsingleton α] : Subsingleton (Quotient s) := Quot.Subsingleton
instance
Data
[ "Mathlib.Logic.Relation", "Mathlib.Logic.Unique", "Mathlib.Util.Notation3" ]
Mathlib/Data/Quot.lean
instSubsingletonQuotient
null
instUniqueQuotient (s : Setoid α) [Unique α] : Unique (Quotient s) := Unique.mk' _
instance
Data
[ "Mathlib.Logic.Relation", "Mathlib.Logic.Unique", "Mathlib.Util.Notation3" ]
Mathlib/Data/Quot.lean
instUniqueQuotient
null
protected hrecOn₂ (qa : Quotient sa) (qb : Quotient sb) (f : ∀ a b, φ ⟦a⟧ ⟦b⟧) (c : ∀ a₁ b₁ a₂ b₂, a₁ ≈ a₂ → b₁ ≈ b₂ → f a₁ b₁ ≍ f a₂ b₂) : φ qa qb := Quot.hrecOn₂ qa qb f (fun p ↦ c _ _ _ _ p (Setoid.refl _)) fun p ↦ c _ _ _ _ (Setoid.refl _) p
def
Data
[ "Mathlib.Logic.Relation", "Mathlib.Logic.Unique", "Mathlib.Util.Notation3" ]
Mathlib/Data/Quot.lean
hrecOn₂
Induction on two `Quotient` arguments `a` and `b`, result type depends on `⟦a⟧` and `⟦b⟧`.
protected map (f : α → β) (h : ∀ ⦃a b : α⦄, a ≈ b → f a ≈ f b) : Quotient sa → Quotient sb := Quot.map f h @[simp]
def
Data
[ "Mathlib.Logic.Relation", "Mathlib.Logic.Unique", "Mathlib.Util.Notation3" ]
Mathlib/Data/Quot.lean
map
Map a function `f : α → β` that sends equivalent elements to equivalent elements to a function `Quotient sa → Quotient sb`. Useful to define unary operations on quotients.
map_mk (f : α → β) (h) (x : α) : Quotient.map f h (⟦x⟧ : Quotient sa) = (⟦f x⟧ : Quotient sb) := rfl variable {γ : Sort*} {sc : Setoid γ}
theorem
Data
[ "Mathlib.Logic.Relation", "Mathlib.Logic.Unique", "Mathlib.Util.Notation3" ]
Mathlib/Data/Quot.lean
map_mk
null
protected map₂ (f : α → β → γ) (h : ∀ ⦃a₁ a₂⦄, a₁ ≈ a₂ → ∀ ⦃b₁ b₂⦄, b₁ ≈ b₂ → f a₁ b₁ ≈ f a₂ b₂) : Quotient sa → Quotient sb → Quotient sc := Quotient.lift₂ (fun x y ↦ ⟦f x y⟧) fun _ _ _ _ h₁ h₂ ↦ Quot.sound <| h h₁ h₂ @[simp]
def
Data
[ "Mathlib.Logic.Relation", "Mathlib.Logic.Unique", "Mathlib.Util.Notation3" ]
Mathlib/Data/Quot.lean
map₂
Map a function `f : α → β → γ` that sends equivalent elements to equivalent elements to a function `f : Quotient sa → Quotient sb → Quotient sc`. Useful to define binary operations on quotients.
map₂_mk (f : α → β → γ) (h) (x : α) (y : β) : Quotient.map₂ f h (⟦x⟧ : Quotient sa) (⟦y⟧ : Quotient sb) = (⟦f x y⟧ : Quotient sc) := rfl
theorem
Data
[ "Mathlib.Logic.Relation", "Mathlib.Logic.Unique", "Mathlib.Util.Notation3" ]
Mathlib/Data/Quot.lean
map₂_mk
null
lift.decidablePred (f : α → Prop) (h : ∀ a b, a ≈ b → f a = f b) [DecidablePred f] : DecidablePred (Quotient.lift f h) := Quot.lift.decidablePred _ _ _
instance
Data
[ "Mathlib.Logic.Relation", "Mathlib.Logic.Unique", "Mathlib.Util.Notation3" ]
Mathlib/Data/Quot.lean
lift.decidablePred
null
lift₂.decidablePred (f : α → β → Prop) (h : ∀ a₁ b₁ a₂ b₂, a₁ ≈ a₂ → b₁ ≈ b₂ → f a₁ b₁ = f a₂ b₂) [hf : ∀ a, DecidablePred (f a)] (q₁ : Quotient sa) : DecidablePred (Quotient.lift₂ f h q₁) := fun q₂ ↦ Quotient.recOnSubsingleton₂ q₁ q₂ hf
instance
Data
[ "Mathlib.Logic.Relation", "Mathlib.Logic.Unique", "Mathlib.Util.Notation3" ]
Mathlib/Data/Quot.lean
lift₂.decidablePred
Note that this provides `DecidableRel (Quotient.lift₂ f h)` when `α = β`.
Quot.eq {α : Type*} {r : α → α → Prop} {x y : α} : Quot.mk r x = Quot.mk r y ↔ Relation.EqvGen r x y := ⟨Quot.eqvGen_exact, Quot.eqvGen_sound⟩ @[simp]
theorem
Data
[ "Mathlib.Logic.Relation", "Mathlib.Logic.Unique", "Mathlib.Util.Notation3" ]
Mathlib/Data/Quot.lean
Quot.eq
null
Quotient.eq {r : Setoid α} {x y : α} : Quotient.mk r x = ⟦y⟧ ↔ r x y := ⟨Quotient.exact, Quotient.sound⟩
theorem
Data
[ "Mathlib.Logic.Relation", "Mathlib.Logic.Unique", "Mathlib.Util.Notation3" ]
Mathlib/Data/Quot.lean
Quotient.eq
null
Quotient.eq_iff_equiv {r : Setoid α} {x y : α} : Quotient.mk r x = ⟦y⟧ ↔ x ≈ y := Quotient.eq
theorem
Data
[ "Mathlib.Logic.Relation", "Mathlib.Logic.Unique", "Mathlib.Util.Notation3" ]
Mathlib/Data/Quot.lean
Quotient.eq_iff_equiv
null
Quotient.forall {α : Sort*} {s : Setoid α} {p : Quotient s → Prop} : (∀ a, p a) ↔ ∀ a : α, p ⟦a⟧ := ⟨fun h _ ↦ h _, fun h a ↦ a.ind h⟩
theorem
Data
[ "Mathlib.Logic.Relation", "Mathlib.Logic.Unique", "Mathlib.Util.Notation3" ]
Mathlib/Data/Quot.lean
Quotient.forall
null
Quotient.exists {α : Sort*} {s : Setoid α} {p : Quotient s → Prop} : (∃ a, p a) ↔ ∃ a : α, p ⟦a⟧ := ⟨fun ⟨q, hq⟩ ↦ q.ind (motive := (p · → _)) .intro hq, fun ⟨a, ha⟩ ↦ ⟨⟦a⟧, ha⟩⟩ @[simp]
theorem
Data
[ "Mathlib.Logic.Relation", "Mathlib.Logic.Unique", "Mathlib.Util.Notation3" ]
Mathlib/Data/Quot.lean
Quotient.exists
null
Quotient.lift_mk {s : Setoid α} (f : α → β) (h : ∀ a b : α, a ≈ b → f a = f b) (x : α) : Quotient.lift f h (Quotient.mk s x) = f x := rfl @[simp]
theorem
Data
[ "Mathlib.Logic.Relation", "Mathlib.Logic.Unique", "Mathlib.Util.Notation3" ]
Mathlib/Data/Quot.lean
Quotient.lift_mk
null
Quotient.lift_comp_mk {_ : Setoid α} (f : α → β) (h : ∀ a b : α, a ≈ b → f a = f b) : Quotient.lift f h ∘ Quotient.mk _ = f := rfl @[simp]
theorem
Data
[ "Mathlib.Logic.Relation", "Mathlib.Logic.Unique", "Mathlib.Util.Notation3" ]
Mathlib/Data/Quot.lean
Quotient.lift_comp_mk
null
Quotient.lift_surjective_iff {α β : Sort*} {s : Setoid α} (f : α → β) (h : ∀ (a b : α), a ≈ b → f a = f b) : Function.Surjective (Quotient.lift f h : Quotient s → β) ↔ Function.Surjective f := Quot.surjective_lift h
theorem
Data
[ "Mathlib.Logic.Relation", "Mathlib.Logic.Unique", "Mathlib.Util.Notation3" ]
Mathlib/Data/Quot.lean
Quotient.lift_surjective_iff
null
Quotient.lift_surjective {α β : Sort*} {s : Setoid α} (f : α → β) (h : ∀ (a b : α), a ≈ b → f a = f b) (hf : Function.Surjective f) : Function.Surjective (Quotient.lift f h : Quotient s → β) := (Quot.surjective_lift h).mpr hf @[simp]
theorem
Data
[ "Mathlib.Logic.Relation", "Mathlib.Logic.Unique", "Mathlib.Util.Notation3" ]
Mathlib/Data/Quot.lean
Quotient.lift_surjective
null
Quotient.lift₂_mk {α : Sort*} {β : Sort*} {γ : Sort*} {_ : Setoid α} {_ : Setoid β} (f : α → β → γ) (h : ∀ (a₁ : α) (a₂ : β) (b₁ : α) (b₂ : β), a₁ ≈ b₁ → a₂ ≈ b₂ → f a₁ a₂ = f b₁ b₂) (a : α) (b : β) : Quotient.lift₂ f h (Quotient.mk _ a) (Quotient.mk _ b) = f a b := rfl
theorem
Data
[ "Mathlib.Logic.Relation", "Mathlib.Logic.Unique", "Mathlib.Util.Notation3" ]
Mathlib/Data/Quot.lean
Quotient.lift₂_mk
null
Quotient.liftOn_mk {s : Setoid α} (f : α → β) (h : ∀ a b : α, a ≈ b → f a = f b) (x : α) : Quotient.liftOn (Quotient.mk s x) f h = f x := rfl @[simp]
theorem
Data
[ "Mathlib.Logic.Relation", "Mathlib.Logic.Unique", "Mathlib.Util.Notation3" ]
Mathlib/Data/Quot.lean
Quotient.liftOn_mk
null
Quotient.liftOn₂_mk {α : Sort*} {β : Sort*} {γ : Sort*} {_ : Setoid α} {_ : Setoid β} (f : α → β → γ) (h : ∀ (a₁ : α) (b₁ : β) (a₂ : α) (b₂ : β), a₁ ≈ a₂ → b₁ ≈ b₂ → f a₁ b₁ = f a₂ b₂) (x : α) (y : β) : Quotient.liftOn₂ (Quotient.mk _ x) (Quotient.mk _ y) f h = f x y := rfl
theorem
Data
[ "Mathlib.Logic.Relation", "Mathlib.Logic.Unique", "Mathlib.Util.Notation3" ]
Mathlib/Data/Quot.lean
Quotient.liftOn₂_mk
null
Quot.mk_surjective {r : α → α → Prop} : Function.Surjective (Quot.mk r) := Quot.exists_rep
theorem
Data
[ "Mathlib.Logic.Relation", "Mathlib.Logic.Unique", "Mathlib.Util.Notation3" ]
Mathlib/Data/Quot.lean
Quot.mk_surjective
`Quot.mk r` is a surjective function.
Quotient.mk_surjective {s : Setoid α} : Function.Surjective (Quotient.mk s) := Quot.exists_rep
theorem
Data
[ "Mathlib.Logic.Relation", "Mathlib.Logic.Unique", "Mathlib.Util.Notation3" ]
Mathlib/Data/Quot.lean
Quotient.mk_surjective
`Quotient.mk` is a surjective function.
Quotient.mk'_surjective [s : Setoid α] : Function.Surjective (Quotient.mk' : α → Quotient s) := Quot.exists_rep
theorem
Data
[ "Mathlib.Logic.Relation", "Mathlib.Logic.Unique", "Mathlib.Util.Notation3" ]
Mathlib/Data/Quot.lean
Quotient.mk'_surjective
`Quotient.mk'` is a surjective function.
noncomputable Quot.out {r : α → α → Prop} (q : Quot r) : α := Classical.choose (Quot.exists_rep q)
def
Data
[ "Mathlib.Logic.Relation", "Mathlib.Logic.Unique", "Mathlib.Util.Notation3" ]
Mathlib/Data/Quot.lean
Quot.out
Choose an element of the equivalence class using the axiom of choice. Sound but noncomputable.
unsafe Quot.unquot {r : α → α → Prop} : Quot r → α := cast lcProof @[simp]
def
Data
[ "Mathlib.Logic.Relation", "Mathlib.Logic.Unique", "Mathlib.Util.Notation3" ]
Mathlib/Data/Quot.lean
Quot.unquot
Unwrap the VM representation of a quotient to obtain an element of the equivalence class. Computable but unsound.
Quot.out_eq {r : α → α → Prop} (q : Quot r) : Quot.mk r q.out = q := Classical.choose_spec (Quot.exists_rep q)
theorem
Data
[ "Mathlib.Logic.Relation", "Mathlib.Logic.Unique", "Mathlib.Util.Notation3" ]
Mathlib/Data/Quot.lean
Quot.out_eq
null
noncomputable Quotient.out {s : Setoid α} : Quotient s → α := Quot.out @[simp]
def
Data
[ "Mathlib.Logic.Relation", "Mathlib.Logic.Unique", "Mathlib.Util.Notation3" ]
Mathlib/Data/Quot.lean
Quotient.out
Choose an element of the equivalence class using the axiom of choice. Sound but noncomputable.
Quotient.out_eq {s : Setoid α} (q : Quotient s) : ⟦q.out⟧ = q := Quot.out_eq q
theorem
Data
[ "Mathlib.Logic.Relation", "Mathlib.Logic.Unique", "Mathlib.Util.Notation3" ]
Mathlib/Data/Quot.lean
Quotient.out_eq
null
Quotient.mk_out {s : Setoid α} (a : α) : s (⟦a⟧ : Quotient s).out a := Quotient.exact (Quotient.out_eq _)
theorem
Data
[ "Mathlib.Logic.Relation", "Mathlib.Logic.Unique", "Mathlib.Util.Notation3" ]
Mathlib/Data/Quot.lean
Quotient.mk_out
null
Quotient.mk_eq_iff_out {s : Setoid α} {x : α} {y : Quotient s} : ⟦x⟧ = y ↔ x ≈ Quotient.out y := by refine Iff.trans ?_ Quotient.eq rw [Quotient.out_eq y]
theorem
Data
[ "Mathlib.Logic.Relation", "Mathlib.Logic.Unique", "Mathlib.Util.Notation3" ]
Mathlib/Data/Quot.lean
Quotient.mk_eq_iff_out
null
Quotient.eq_mk_iff_out {s : Setoid α} {x : Quotient s} {y : α} : x = ⟦y⟧ ↔ Quotient.out x ≈ y := by refine Iff.trans ?_ Quotient.eq rw [Quotient.out_eq x] @[simp]
theorem
Data
[ "Mathlib.Logic.Relation", "Mathlib.Logic.Unique", "Mathlib.Util.Notation3" ]
Mathlib/Data/Quot.lean
Quotient.eq_mk_iff_out
null
Quotient.out_equiv_out {s : Setoid α} {x y : Quotient s} : x.out ≈ y.out ↔ x = y := by rw [← Quotient.eq_mk_iff_out, Quotient.out_eq]
theorem
Data
[ "Mathlib.Logic.Relation", "Mathlib.Logic.Unique", "Mathlib.Util.Notation3" ]
Mathlib/Data/Quot.lean
Quotient.out_equiv_out
null
Quotient.out_injective {s : Setoid α} : Function.Injective (@Quotient.out α s) := fun _ _ h ↦ Quotient.out_equiv_out.1 <| h ▸ Setoid.refl _ @[simp]
theorem
Data
[ "Mathlib.Logic.Relation", "Mathlib.Logic.Unique", "Mathlib.Util.Notation3" ]
Mathlib/Data/Quot.lean
Quotient.out_injective
null
Quotient.out_inj {s : Setoid α} {x y : Quotient s} : x.out = y.out ↔ x = y := ⟨fun h ↦ Quotient.out_injective h, fun h ↦ h ▸ rfl⟩
theorem
Data
[ "Mathlib.Logic.Relation", "Mathlib.Logic.Unique", "Mathlib.Util.Notation3" ]
Mathlib/Data/Quot.lean
Quotient.out_inj
null
piSetoid {ι : Sort*} {α : ι → Sort*} [∀ i, Setoid (α i)] : Setoid (∀ i, α i) where r a b := ∀ i, a i ≈ b i iseqv := ⟨fun _ _ ↦ Setoid.refl _, fun h _ ↦ Setoid.symm (h _), fun h₁ h₂ _ ↦ Setoid.trans (h₁ _) (h₂ _)⟩
instance
Data
[ "Mathlib.Logic.Relation", "Mathlib.Logic.Unique", "Mathlib.Util.Notation3" ]
Mathlib/Data/Quot.lean
piSetoid
null
Quotient.eval {ι : Type*} {α : ι → Sort*} {S : ∀ i, Setoid (α i)} (q : @Quotient (∀ i, α i) (by infer_instance)) (i : ι) : Quotient (S i) := q.map (· i) fun _ _ h ↦ by exact h i @[simp]
def
Data
[ "Mathlib.Logic.Relation", "Mathlib.Logic.Unique", "Mathlib.Util.Notation3" ]
Mathlib/Data/Quot.lean
Quotient.eval
Given a class of functions `q : @Quotient (∀ i, α i) _`, returns the class of `i`-th projection `Quotient (S i)`.
Quotient.eval_mk {ι : Type*} {α : ι → Type*} {S : ∀ i, Setoid (α i)} (f : ∀ i, α i) : Quotient.eval (S := S) ⟦f⟧ = fun i ↦ ⟦f i⟧ := rfl
theorem
Data
[ "Mathlib.Logic.Relation", "Mathlib.Logic.Unique", "Mathlib.Util.Notation3" ]
Mathlib/Data/Quot.lean
Quotient.eval_mk
null
noncomputable Quotient.choice {ι : Type*} {α : ι → Type*} {S : ∀ i, Setoid (α i)} (f : ∀ i, Quotient (S i)) : @Quotient (∀ i, α i) (by infer_instance) := ⟦fun i ↦ (f i).out⟧ @[simp]
def
Data
[ "Mathlib.Logic.Relation", "Mathlib.Logic.Unique", "Mathlib.Util.Notation3" ]
Mathlib/Data/Quot.lean
Quotient.choice
Given a function `f : Π i, Quotient (S i)`, returns the class of functions `Π i, α i` sending each `i` to an element of the class `f i`.
Quotient.choice_eq {ι : Type*} {α : ι → Type*} {S : ∀ i, Setoid (α i)} (f : ∀ i, α i) : (Quotient.choice (S := S) fun i ↦ ⟦f i⟧) = ⟦f⟧ := Quotient.sound fun _ ↦ Quotient.mk_out _ @[elab_as_elim]
theorem
Data
[ "Mathlib.Logic.Relation", "Mathlib.Logic.Unique", "Mathlib.Util.Notation3" ]
Mathlib/Data/Quot.lean
Quotient.choice_eq
null
Quotient.induction_on_pi {ι : Type*} {α : ι → Sort*} {s : ∀ i, Setoid (α i)} {p : (∀ i, Quotient (s i)) → Prop} (f : ∀ i, Quotient (s i)) (h : ∀ a : ∀ i, α i, p fun i ↦ ⟦a i⟧) : p f := by rw [← (funext fun i ↦ Quotient.out_eq (f i) : (fun i ↦ ⟦(f i).out⟧) = f)] apply h
theorem
Data
[ "Mathlib.Logic.Relation", "Mathlib.Logic.Unique", "Mathlib.Util.Notation3" ]
Mathlib/Data/Quot.lean
Quotient.induction_on_pi
null
nonempty_quotient_iff (s : Setoid α) : Nonempty (Quotient s) ↔ Nonempty α := ⟨fun ⟨a⟩ ↦ Quotient.inductionOn a Nonempty.intro, fun ⟨a⟩ ↦ ⟨⟦a⟧⟩⟩ /-! ### Truncation -/
theorem
Data
[ "Mathlib.Logic.Relation", "Mathlib.Logic.Unique", "Mathlib.Util.Notation3" ]
Mathlib/Data/Quot.lean
nonempty_quotient_iff
null
true_equivalence : @Equivalence α fun _ _ ↦ True := ⟨fun _ ↦ trivial, fun _ ↦ trivial, fun _ _ ↦ trivial⟩
theorem
Data
[ "Mathlib.Logic.Relation", "Mathlib.Logic.Unique", "Mathlib.Util.Notation3" ]
Mathlib/Data/Quot.lean
true_equivalence
null
trueSetoid : Setoid α := ⟨_, true_equivalence⟩
def
Data
[ "Mathlib.Logic.Relation", "Mathlib.Logic.Unique", "Mathlib.Util.Notation3" ]
Mathlib/Data/Quot.lean
trueSetoid
Always-true relation as a `Setoid`. Note that in later files the preferred spelling is `⊤ : Setoid α`.
Trunc.{u} (α : Sort u) : Sort u := @Quotient α trueSetoid
def
Data
[ "Mathlib.Logic.Relation", "Mathlib.Logic.Unique", "Mathlib.Util.Notation3" ]
Mathlib/Data/Quot.lean
Trunc.
`Trunc α` is the quotient of `α` by the always-true relation. This is related to the propositional truncation in HoTT, and is similar in effect to `Nonempty α`, but unlike `Nonempty α`, `Trunc α` is data, so the VM representation is the same as `α`, and so this can be used to maintain computability.
mk (a : α) : Trunc α := Quot.mk _ a
def
Data
[ "Mathlib.Logic.Relation", "Mathlib.Logic.Unique", "Mathlib.Util.Notation3" ]
Mathlib/Data/Quot.lean
mk
Constructor for `Trunc α`
lift (f : α → β) (c : ∀ a b : α, f a = f b) : Trunc α → β := Quot.lift f fun a b _ ↦ c a b
def
Data
[ "Mathlib.Logic.Relation", "Mathlib.Logic.Unique", "Mathlib.Util.Notation3" ]
Mathlib/Data/Quot.lean
lift
Any constant function lifts to a function out of the truncation
ind {β : Trunc α → Prop} : (∀ a : α, β (mk a)) → ∀ q : Trunc α, β q := Quot.ind
theorem
Data
[ "Mathlib.Logic.Relation", "Mathlib.Logic.Unique", "Mathlib.Util.Notation3" ]
Mathlib/Data/Quot.lean
ind
null
protected lift_mk (f : α → β) (c) (a : α) : lift f c (mk a) = f a := rfl
theorem
Data
[ "Mathlib.Logic.Relation", "Mathlib.Logic.Unique", "Mathlib.Util.Notation3" ]
Mathlib/Data/Quot.lean
lift_mk
null
protected liftOn (q : Trunc α) (f : α → β) (c : ∀ a b : α, f a = f b) : β := lift f c q @[elab_as_elim]
def
Data
[ "Mathlib.Logic.Relation", "Mathlib.Logic.Unique", "Mathlib.Util.Notation3" ]
Mathlib/Data/Quot.lean
liftOn
Lift a constant function on `q : Trunc α`.
protected induction_on {β : Trunc α → Prop} (q : Trunc α) (h : ∀ a, β (mk a)) : β q := ind h q
theorem
Data
[ "Mathlib.Logic.Relation", "Mathlib.Logic.Unique", "Mathlib.Util.Notation3" ]
Mathlib/Data/Quot.lean
induction_on
null
exists_rep (q : Trunc α) : ∃ a : α, mk a = q := Quot.exists_rep q @[elab_as_elim]
theorem
Data
[ "Mathlib.Logic.Relation", "Mathlib.Logic.Unique", "Mathlib.Util.Notation3" ]
Mathlib/Data/Quot.lean
exists_rep
null
protected induction_on₂ {C : Trunc α → Trunc β → Prop} (q₁ : Trunc α) (q₂ : Trunc β) (h : ∀ a b, C (mk a) (mk b)) : C q₁ q₂ := Trunc.induction_on q₁ fun a₁ ↦ Trunc.induction_on q₂ (h a₁)
theorem
Data
[ "Mathlib.Logic.Relation", "Mathlib.Logic.Unique", "Mathlib.Util.Notation3" ]
Mathlib/Data/Quot.lean
induction_on₂
null
protected eq (a b : Trunc α) : a = b := Trunc.induction_on₂ a b fun _ _ ↦ Quot.sound trivial
theorem
Data
[ "Mathlib.Logic.Relation", "Mathlib.Logic.Unique", "Mathlib.Util.Notation3" ]
Mathlib/Data/Quot.lean
eq
null
instSubsingletonTrunc : Subsingleton (Trunc α) := ⟨Trunc.eq⟩
instance
Data
[ "Mathlib.Logic.Relation", "Mathlib.Logic.Unique", "Mathlib.Util.Notation3" ]
Mathlib/Data/Quot.lean
instSubsingletonTrunc
null
bind (q : Trunc α) (f : α → Trunc β) : Trunc β := Trunc.liftOn q f fun _ _ ↦ Trunc.eq _ _
def
Data
[ "Mathlib.Logic.Relation", "Mathlib.Logic.Unique", "Mathlib.Util.Notation3" ]
Mathlib/Data/Quot.lean
bind
The `bind` operator for the `Trunc` monad.
map (f : α → β) (q : Trunc α) : Trunc β := bind q (Trunc.mk ∘ f)
def
Data
[ "Mathlib.Logic.Relation", "Mathlib.Logic.Unique", "Mathlib.Util.Notation3" ]
Mathlib/Data/Quot.lean
map
A function `f : α → β` defines a function `map f : Trunc α → Trunc β`.
@[elab_as_elim] protected rec (f : ∀ a, C (mk a)) (h : ∀ a b : α, (Eq.ndrec (f a) (Trunc.eq (mk a) (mk b)) : C (mk b)) = f b) (q : Trunc α) : C q := Quot.rec f (fun a b _ ↦ h a b) q
def
Data
[ "Mathlib.Logic.Relation", "Mathlib.Logic.Unique", "Mathlib.Util.Notation3" ]
Mathlib/Data/Quot.lean
rec
Recursion/induction principle for `Trunc`.
@[elab_as_elim] protected recOn (q : Trunc α) (f : ∀ a, C (mk a)) (h : ∀ a b : α, (Eq.ndrec (f a) (Trunc.eq (mk a) (mk b)) : C (mk b)) = f b) : C q := Trunc.rec f h q
def
Data
[ "Mathlib.Logic.Relation", "Mathlib.Logic.Unique", "Mathlib.Util.Notation3" ]
Mathlib/Data/Quot.lean
recOn
A version of `Trunc.rec` taking `q : Trunc α` as the first argument.
@[elab_as_elim] protected recOnSubsingleton [∀ a, Subsingleton (C (mk a))] (q : Trunc α) (f : ∀ a, C (mk a)) : C q := Trunc.rec f (fun _ b ↦ Subsingleton.elim _ (f b)) q
def
Data
[ "Mathlib.Logic.Relation", "Mathlib.Logic.Unique", "Mathlib.Util.Notation3" ]
Mathlib/Data/Quot.lean
recOnSubsingleton
A version of `Trunc.recOn` assuming the codomain is a `Subsingleton`.
noncomputable out : Trunc α → α := Quot.out @[simp]
def
Data
[ "Mathlib.Logic.Relation", "Mathlib.Logic.Unique", "Mathlib.Util.Notation3" ]
Mathlib/Data/Quot.lean
out
Noncomputably extract a representative of `Trunc α` (using the axiom of choice).
out_eq (q : Trunc α) : mk q.out = q := Trunc.eq _ _
theorem
Data
[ "Mathlib.Logic.Relation", "Mathlib.Logic.Unique", "Mathlib.Util.Notation3" ]
Mathlib/Data/Quot.lean
out_eq
null