Quotient types #
This module extends the core library's treatment of quotient types (Init.Core
).
Tags #
quotient
Equations
- Quot.instInhabitedQuot r = { default := Quot.mk r default }
Equations
- ⋯ = ⋯
Equations
- Quot.instUniqueQuot = Unique.mk' (Quot ra)
Recursion on two Quotient
arguments a
and b
, result type depends on ⟦a⟧
and ⟦b⟧
.
Equations
- Quot.hrecOn₂ qa qb f ca cb = Quot.hrecOn qa (fun (a : α) => Quot.hrecOn qb (f a) ⋯) ⋯
Instances For
Descends a function f : α → β → γ
to quotients of α
and β
.
Equations
- Quot.lift₂ f hr hs q₁ q₂ = Quot.lift (fun (a : α) => Quot.lift (f a) ⋯) ⋯ q₁ q₂
Instances For
Descends a function f : α → β → γ
to quotients of α
and β
and applies it.
Equations
- Quot.liftOn₂ p q f hr hs = Quot.lift₂ f hr hs p q
Instances For
Descends a function f : α → β → γ
to quotients of α
and β
with values in a quotient of
γ
.
Equations
- Quot.map₂ f hr hs q₁ q₂ = Quot.lift₂ (fun (a : α) (b : β) => Quot.mk t (f a b)) ⋯ ⋯ q₁ q₂
Instances For
A binary version of Quot.recOnSubsingleton
.
Equations
- Quot.recOnSubsingleton₂ q₁ q₂ f = Quot.recOnSubsingleton q₁ fun (a : α) => Quot.recOnSubsingleton q₂ fun (b : β) => f a b
Instances For
Equations
- Quot.lift.decidablePred r f h q = Quot.recOnSubsingleton q hf
Note that this provides DecidableRel (Quot.Lift₂ f ha hb)
when α = β
.
Equations
- Quot.lift₂.decidablePred r s f ha hb q₁ q₂ = Quot.recOnSubsingleton₂ q₁ q₂ hf
Equations
- Quot.instDecidableLiftOnProp r q f h = Quot.lift.decidablePred (fun (a b : α) => r a b) f h q
Equations
- Quot.instDecidableLiftOn₂Prop r s q₁ q₂ f ha hb = Quot.lift₂.decidablePred (fun (a₁ a₂ : α) => r a₁ a₂) (fun (b₁ b₂ : β) => s b₁ b₂) f ha hb q₁ q₂
The canonical quotient map into a Quotient
.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Pretty printer defined by notation3
command.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- Quotient.instInhabitedQuotient s = { default := ⟦default⟧ }
Equations
- ⋯ = ⋯
Equations
Induction on two Quotient
arguments a
and b
, result type depends on ⟦a⟧
and ⟦b⟧
.
Equations
- Quotient.hrecOn₂ qa qb f c = Quot.hrecOn₂ qa qb f ⋯ ⋯
Instances For
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.
Equations
- Quotient.map f h = Quot.map f h
Instances For
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.
Equations
- Quotient.map₂ f h = Quotient.lift₂ (fun (x : α) (y : β) => ⟦f x y⟧) ⋯
Instances For
Equations
- Quotient.lift.decidablePred f h = Quot.lift.decidablePred (fun (a b : α) => a ≈ b) f h
Note that this provides DecidableRel (Quotient.lift₂ f h)
when α = β
.
Equations
- Quotient.lift₂.decidablePred f h q₁ q₂ = Quotient.recOnSubsingleton₂ q₁ q₂ hf
Equations
Equations
- Quotient.instDecidableLiftOn₂Prop q₁ q₂ f h = Quotient.lift₂.decidablePred f h q₁ q₂
Quot.mk r
is a surjective function.
Quotient.mk'
is a surjective function.
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
.
Equations
- Quotient.choice f = ⟦fun (i : ι) => Quotient.out (f i)⟧
Instances For
Truncation #
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.
Instances For
Any constant function lifts to a function out of the truncation
Equations
- Trunc.lift f c = Quot.lift f ⋯
Instances For
Lift a constant function on q : Trunc α
.
Equations
- Trunc.liftOn q f c = Trunc.lift f c q
Instances For
A version of Trunc.recOn
assuming the codomain is a Subsingleton
.
Equations
- Trunc.recOnSubsingleton q f = Trunc.rec f ⋯ q
Instances For
Versions of quotient definitions and lemmas ending in '
use unification instead
of typeclass inference for inferring the Setoid
argument. This is useful when there are
several different quotient relations on a type, for example quotient groups, rings and modules.
A version of Quotient.mk
taking {s : Setoid α}
as an implicit argument instead of an
instance argument.
Equations
- Quotient.mk'' a = Quot.mk Setoid.r a
Instances For
Quotient.mk''
is a surjective function.
A version of Quotient.liftOn
taking {s : Setoid α}
as an implicit argument instead of an
instance argument.
Equations
- Quotient.liftOn' q f h = Quotient.liftOn q f h
Instances For
A version of Quotient.liftOn₂
taking {s₁ : Setoid α} {s₂ : Setoid β}
as implicit arguments
instead of instance arguments.
Equations
- Quotient.liftOn₂' q₁ q₂ f h = Quotient.liftOn₂ q₁ q₂ f h
Instances For
A version of Quotient.ind
taking {s : Setoid α}
as an implicit argument instead of an
instance argument.
A version of Quotient.ind₂
taking {s₁ : Setoid α} {s₂ : Setoid β}
as implicit arguments
instead of instance arguments.
A version of Quotient.inductionOn
taking {s : Setoid α}
as an implicit argument instead
of an instance argument.
A version of Quotient.inductionOn₂
taking {s₁ : Setoid α} {s₂ : Setoid β}
as implicit
arguments instead of instance arguments.
A version of Quotient.inductionOn₃
taking {s₁ : Setoid α} {s₂ : Setoid β} {s₃ : Setoid γ}
as implicit arguments instead of instance arguments.
A version of Quotient.recOnSubsingleton
taking {s₁ : Setoid α}
as an implicit argument
instead of an instance argument.
Equations
Instances For
A version of Quotient.recOnSubsingleton₂
taking {s₁ : Setoid α} {s₂ : Setoid α}
as implicit arguments instead of instance arguments.
Equations
- Quotient.recOnSubsingleton₂' q₁ q₂ f = Quotient.recOnSubsingleton₂ q₁ q₂ f
Instances For
Recursion on a Quotient
argument a
, result type depends on ⟦a⟧
.
Equations
- Quotient.hrecOn' qa f c = Quot.hrecOn qa f c
Instances For
Recursion on two Quotient
arguments a
and b
, result type depends on ⟦a⟧
and ⟦b⟧
.
Equations
- Quotient.hrecOn₂' qa qb f c = Quotient.hrecOn₂ qa qb f c
Instances For
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.
Equations
- Quotient.map' f h = Quot.map f h
Instances For
A version of Quotient.map₂
using curly braces and unification.
Equations
- Quotient.map₂' f h = Quotient.map₂ f h
Instances For
A version of Quotient.out
taking {s₁ : Setoid α}
as an implicit argument instead of an
instance argument.
Equations
Instances For
Equations
Equations
- Quotient.instDecidableLiftOn₂'Prop q₁ q₂ f h = Quotient.lift₂.decidablePred (fun (a₁ : α) (b₁ : β) => f a₁ b₁) h q₁ q₂